Changes between Version 4 and Version 5 of P2


Ignore:
Timestamp:
02/13/26 14:21:23 (5 weeks ago)
Author:
211099
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • P2

    v4 v5  
    1 = Relational Design for ChapterX=
     1= Relational Design for ChapterX =
    22
    33== Notation ==
    44
    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__
    98
    109== Tables ==
    1110
    12 1. STORY(__story_ID__, mature_content, short_description, image, content, user_ID*(WRITER))
     111. STORY(__'''story_ID'''__, '''mature_content''', '''short_description''', image, '''content''', __user_ID__*)
     12   * user_ID references WRITER
    1313   * status (multi-valued attribute, see table STATUS)
    1414
    15 2. STATUS(__story_ID*(STORY)__, __status__)
     152. STATUS(__'''story_ID'''__*, __'''status'''__)
     16   * story_ID references STORY
    1617
    17 3. USER(__user_ID__, username, email, name, surname, password)
     183. USER(__'''user_ID'''__, '''username''', '''email''', '''name''', '''surname''', '''password''')
    1819
    19 4. ADMIN(__user_ID*(USER)__)
     204. ADMIN(__'''user_ID'''__*)
     21   * user_ID references USER
    2022
    21 5. REGULAR_USER(__user_ID*(USER)__)
     235. REGULAR_USER(__'''user_ID'''__*)
     24   * user_ID references USER
    2225
    23 6. WRITER(__user_ID*(USER)__, created_story)
     266. WRITER(__'''user_ID'''__*, created_story)
     27   * user_ID references USER
    2428
    25 7. CHAPTER(__chapter_ID__, chapter_name, title, content, word_count, rating, published_at, view_count, story_ID*(STORY))
     297. CHAPTER(__'''chapter_ID'''__, '''chapter_name''', '''title''', '''content''', word_count, rating, '''published_at''', view_count, __story_ID__*)
     30   * story_ID references STORY
    2631
    27 8. GENRE(__genre_ID__, name)
     328. GENRE(__'''genre_ID'''__, '''name''')
    2833
    29 9. READING_LIST(__list_ID__, name, content, is_public, user_ID*(USER))
     349. READING_LIST(__'''list_ID'''__, '''name''', content, '''is_public''', __user_ID__*)
     35   * user_ID references USER
    3036
    31 10. NOTIFICATION(__notification_ID__, content, content_type, user_ID*(USER))
     3710. NOTIFICATION(__'''notification_ID'''__, '''content''', '''content_type''', __user_ID__*)
     38    * user_ID references USER
    3239
    33 11. AI_SUGGESTION(__suggestion_ID__, original_text, suggested_text, suggestion_type, accepted, story_ID*(STORY))
     4011. AI_SUGGESTION(__'''suggestion_ID'''__, '''original_text''', '''suggested_text''', '''suggestion_type''', '''accepted''', __story_ID__*)
     41    * story_ID references STORY
    3442
    35 12. LIKE(__user_ID*(USER)__, __story_ID*(STORY)__)
     4312. LIKE(__'''user_ID'''__*, __'''story_ID'''__*)
     44    * user_ID references USER
     45    * story_ID references STORY
    3646
    37 13. COMMENT(__comment_ID__, content, user_ID*(USER), story_ID*(STORY))
     4713. COMMENT(__'''comment_ID'''__, '''content''', __user_ID__*, __story_ID__*)
     48    * user_ID references USER
     49    * story_ID references STORY
    3850
    39 14. COLLABORATION(__user_ID*(USER)__, __story_ID*(STORY)__, role, permission_level)
     5114. COLLABORATION(__'''user_ID'''__*, __'''story_ID'''__*, role, permission_level)
     52    * user_ID references USER
     53    * story_ID references STORY
    4054    * role (multi-valued attribute, see table ROLE)
    4155    * permission_level (multi-valued attribute, see table PERMISSION_LEVEL)
    4256
    43 15. ROLE(__user_ID*(COLLABORATION)__, __story_ID*(COLLABORATION)__, __role__)
     5715. ROLE(__'''user_ID'''__*, __'''story_ID'''__*, __'''role'''__)
     58    * user_ID references COLLABORATION
     59    * story_ID references COLLABORATION
    4460
    45 16. PERMISSION_LEVEL(__user_ID*(COLLABORATION)__, __story_ID*(COLLABORATION)__, __permission_level__)
     6116. PERMISSION_LEVEL(__'''user_ID'''__*, __'''story_ID'''__*, __'''permission_level'''__)
     62    * user_ID references COLLABORATION
     63    * story_ID references COLLABORATION
    4664
    47 17. HAS_GENRE(__story_ID*(STORY)__, __genre_ID*(GENRE)__)
     6517. HAS_GENRE(__'''story_ID'''__*, __'''genre_ID'''__*)
     66    * story_ID references STORY
     67    * genre_ID references GENRE
    4868
    4969=== DDL script for creation and deletion of tables ===