-
-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1361 Add image deletion #1603
base: main
Are you sure you want to change the base?
1361 Add image deletion #1603
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #1603 +/- ##
============================================
+ Coverage 13.78% 14.83% +1.05%
- Complexity 454 482 +28
============================================
Files 257 258 +1
Lines 8503 8514 +11
Branches 881 882 +1
============================================
+ Hits 1172 1263 +91
+ Misses 7279 7196 -83
- Partials 52 55 +3 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting this when trying to delete an image that is being used by a storybook chapter:
13:58:27.789 [qtp1974701110-20] WARN org.hibernate.engine.jdbc.spi.SqlExceptionHelper - SQL Error: -8, SQLState: 23504
13:58:27.789 [qtp1974701110-20] ERROR org.hibernate.engine.jdbc.spi.SqlExceptionHelper - integrity constraint violation: foreign key no action; FKCNLKSDIKTH82EC6NIA8TB3CPS table: STORYBOOKCHAPTER
@tomaszsmy Note that there are two ways an Image can be used in a storybooks: 1) as a cover image, or 2) as a chapter image.
So we need to make it impossible to delete an Image if it is already being used in a storybook. Only images that are not used anywhere should be possible to delete.
Also, to make your task a bit easier, here you can see the various Image_
tables in the database:
> SHOW TABLES;
+--------------------------------------------+
| Tables_in_webapp-eng |
+--------------------------------------------+
| Application |
| ApplicationVersion |
| Application_literacySkills |
| Application_numeracySkills |
| Audio |
| AudioContributionEvent |
| AudioPeerReviewEvent |
| Audio_Letter |
| Audio_Number |
| Audio_Word |
| Audio_literacySkills |
| Audio_numeracySkills |
| Contributor |
| Contributor_roles |
| DbMigration |
| Device |
| Emoji |
| Emoji_Word |
| Image |
| ImageContributionEvent |
| Image_Letter |
| Image_Number |
| Image_Word |
| Image_literacySkills |
| Image_numeracySkills |
| Letter |
| LetterContributionEvent |
| LetterLearningEvent |
| LetterSoundCorrespondence |
| LetterSoundCorrespondenceContributionEvent |
| LetterSoundCorrespondencePeerReviewEvent |
| LetterSoundCorrespondence_Letter |
| LetterSoundCorrespondence_Sound |
| Number |
| NumberContributionEvent |
| NumberPeerReviewEvent |
| Number_Word |
| Sound |
| SoundContributionEvent |
| StoryBook |
| StoryBookChapter |
| StoryBookContributionEvent |
| StoryBookLearningEvent |
| StoryBookParagraph |
| StoryBookParagraph_Word |
| StoryBookPeerReviewEvent |
| Syllable |
| Syllable_Sound |
| Video |
| Video_Letter |
| Video_Number |
| Video_Word |
| Video_literacySkills |
| Video_numeracySkills |
| Word |
| WordContributionEvent |
| WordLearningEvent |
| WordPeerReviewEvent |
| Word_LetterSoundCorrespondence |
+--------------------------------------------+
59 rows in set (0.00 sec)
These can also be seen in https://github.com/elimu-ai/webapp/blob/main/src/main/resources/META-INF/jpa-schema-export.sql
No description provided.