Changes between Version 4 and Version 5 of P2
- Timestamp:
- 02/13/26 14:21:23 (5 weeks ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
P2
v4 v5 1 = Relational Design for ChapterX =1 = Relational Design for ChapterX = 2 2 3 3 == Notation == 4 4 5 * Primary keys are bolded and underlined. 6 * Foreign keys are marked with `*` at the end of their name and the referenced entity is written in parentheses. 7 * Complex attributes are bolded, and their containing attributes are following the, made italic. 8 * Multivalued attributes have their own table 5 * Primary keys are marked with __'''bold and underlined'''__ 6 * Required attributes are marked with '''bold''' 7 * Foreign keys are marked with * and __underlined__ 9 8 10 9 == Tables == 11 10 12 1. STORY(__story_ID__, mature_content, short_description, image, content, user_ID*(WRITER)) 11 1. STORY(__'''story_ID'''__, '''mature_content''', '''short_description''', image, '''content''', __user_ID__*) 12 * user_ID references WRITER 13 13 * status (multi-valued attribute, see table STATUS) 14 14 15 2. STATUS(__story_ID*(STORY)__, __status__) 15 2. STATUS(__'''story_ID'''__*, __'''status'''__) 16 * story_ID references STORY 16 17 17 3. USER(__ user_ID__, username, email, name, surname, password)18 3. USER(__'''user_ID'''__, '''username''', '''email''', '''name''', '''surname''', '''password''') 18 19 19 4. ADMIN(__user_ID*(USER)__) 20 4. ADMIN(__'''user_ID'''__*) 21 * user_ID references USER 20 22 21 5. REGULAR_USER(__user_ID*(USER)__) 23 5. REGULAR_USER(__'''user_ID'''__*) 24 * user_ID references USER 22 25 23 6. WRITER(__user_ID*(USER)__, created_story) 26 6. WRITER(__'''user_ID'''__*, created_story) 27 * user_ID references USER 24 28 25 7. CHAPTER(__chapter_ID__, chapter_name, title, content, word_count, rating, published_at, view_count, story_ID*(STORY)) 29 7. CHAPTER(__'''chapter_ID'''__, '''chapter_name''', '''title''', '''content''', word_count, rating, '''published_at''', view_count, __story_ID__*) 30 * story_ID references STORY 26 31 27 8. GENRE(__ genre_ID__, name)32 8. GENRE(__'''genre_ID'''__, '''name''') 28 33 29 9. READING_LIST(__list_ID__, name, content, is_public, user_ID*(USER)) 34 9. READING_LIST(__'''list_ID'''__, '''name''', content, '''is_public''', __user_ID__*) 35 * user_ID references USER 30 36 31 10. NOTIFICATION(__notification_ID__, content, content_type, user_ID*(USER)) 37 10. NOTIFICATION(__'''notification_ID'''__, '''content''', '''content_type''', __user_ID__*) 38 * user_ID references USER 32 39 33 11. AI_SUGGESTION(__suggestion_ID__, original_text, suggested_text, suggestion_type, accepted, story_ID*(STORY)) 40 11. AI_SUGGESTION(__'''suggestion_ID'''__, '''original_text''', '''suggested_text''', '''suggestion_type''', '''accepted''', __story_ID__*) 41 * story_ID references STORY 34 42 35 12. LIKE(__user_ID*(USER)__, __story_ID*(STORY)__) 43 12. LIKE(__'''user_ID'''__*, __'''story_ID'''__*) 44 * user_ID references USER 45 * story_ID references STORY 36 46 37 13. COMMENT(__comment_ID__, content, user_ID*(USER), story_ID*(STORY)) 47 13. COMMENT(__'''comment_ID'''__, '''content''', __user_ID__*, __story_ID__*) 48 * user_ID references USER 49 * story_ID references STORY 38 50 39 14. COLLABORATION(__user_ID*(USER)__, __story_ID*(STORY)__, role, permission_level) 51 14. COLLABORATION(__'''user_ID'''__*, __'''story_ID'''__*, role, permission_level) 52 * user_ID references USER 53 * story_ID references STORY 40 54 * role (multi-valued attribute, see table ROLE) 41 55 * permission_level (multi-valued attribute, see table PERMISSION_LEVEL) 42 56 43 15. ROLE(__user_ID*(COLLABORATION)__, __story_ID*(COLLABORATION)__, __role__) 57 15. ROLE(__'''user_ID'''__*, __'''story_ID'''__*, __'''role'''__) 58 * user_ID references COLLABORATION 59 * story_ID references COLLABORATION 44 60 45 16. PERMISSION_LEVEL(__user_ID*(COLLABORATION)__, __story_ID*(COLLABORATION)__, __permission_level__) 61 16. PERMISSION_LEVEL(__'''user_ID'''__*, __'''story_ID'''__*, __'''permission_level'''__) 62 * user_ID references COLLABORATION 63 * story_ID references COLLABORATION 46 64 47 17. HAS_GENRE(__story_ID*(STORY)__, __genre_ID*(GENRE)__) 65 17. HAS_GENRE(__'''story_ID'''__*, __'''genre_ID'''__*) 66 * story_ID references STORY 67 * genre_ID references GENRE 48 68 49 69 === DDL script for creation and deletion of tables ===
