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