Changes between Version 5 and Version 6 of dmlScript.sql


Ignore:
Timestamp:
08/24/26 15:36:58 (13 days ago)
Author:
211099
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • dmlScript.sql

    v5 v6  
    11{{{#!sql
    22TRUNCATE TABLE NEED_APPROVAL CASCADE;
    3 TRUNCATE TABLE NOTIFY CASCADE;
    43TRUNCATE TABLE READING_LIST_ITEMS CASCADE;
    54TRUNCATE TABLE HAS_GENRE CASCADE;
    6 TRUNCATE TABLE PERMISSION_LEVEL CASCADE;
    7 TRUNCATE TABLE ROLES CASCADE;
    85TRUNCATE TABLE COLLABORATION CASCADE;
    96TRUNCATE TABLE COMMENT CASCADE;
    107TRUNCATE TABLE LIKES CASCADE;
    11 TRUNCATE TABLE SUGGESTION_TYPE CASCADE;
    128TRUNCATE TABLE AI_SUGGESTION CASCADE;
    13 TRUNCATE TABLE CONTENT_TYPE CASCADE;
    149TRUNCATE TABLE NOTIFICATION CASCADE;
    1510TRUNCATE TABLE READING_LIST CASCADE;
    1611TRUNCATE TABLE CHAPTER CASCADE;
    17 TRUNCATE TABLE STATUS CASCADE;
    1812TRUNCATE TABLE STORY CASCADE;
    1913TRUNCATE TABLE WRITER CASCADE;
     
    4539('nikolina_reader', 'nikolina@gmail.com', 'Nikolina', 'Kostova', '$2a$10$JlQeommNlQakb2cjxF/i3eEgBbRsDvNUVl8dy6hr3Q8IwOCmsv4Sq', '2025-02-01 09:50:00', '2026-02-13 08:30:00');
    4640
    47 INSERT INTO ADMINS (user_id) VALUES (1);
    48 
    49 INSERT INTO REGULAR_USER (user_id) VALUES
    50 (4),
    51 (5),
    52 (7),
    53 (10);
    54 
    55 INSERT INTO WRITER (user_id) VALUES
    56 (2), 
    57 (3), 
    58 (6), 
    59 (8),
    60 (9); 
     41INSERT INTO ADMINS (user_id, assigned_at) VALUES
     42(1, '2024-01-15 10:00:00');
     43
     44INSERT INTO REGULAR_USER (user_id, joined_at) VALUES
     45(4, '2024-06-05 16:30:00'),
     46(5, '2024-07-18 11:45:00'),
     47(7, '2024-09-30 10:20:00'),
     48(10, '2025-02-01 09:50:00');
     49
     50INSERT INTO WRITER (user_id, bio) VALUES
     51(2, 'Fantasy author from Skopje. Creator of the Eldoria universe. Dragons are real if you write them well.'),
     52(3, 'Romance writer who believes every love story deserves to be told. Coffee addict.'),
     53(6, 'Paranormal romance enthusiast. Writing about vampires, witches and everything in between.'),
     54(8, 'New voice in young adult fiction. Learning and growing with every chapter.'),
     55(9, 'Co-author and editor. Passionate about historical fiction and collaborative storytelling.');
    6156
    6257INSERT INTO GENRE (genre_name) VALUES
     
    7267('Dark Fantasy');
    7368
    74 INSERT INTO STORY (mature_content, title, short_description, image, story_content, user_id, story_created_at, story_updated_at) VALUES
     69INSERT INTO STORY (mature_content, title, short_description, image, story_content, status, user_id, story_created_at, story_updated_at) VALUES
    7570(FALSE,
    7671 'The Chronicles of Eldoria',
     
    7873 'https://images.unsplash.com/photo-dragon-fantasy.jpg',
    7974 'In the ancient realm of Eldoria, where magic flows through crystalline rivers and dragons once ruled the skies, seventeen-year-old Lyra discovers she is the last descendant of the Dragon Keepers. When the prophecy speaks of the final dragon awakening from its thousand-year slumber, Lyra must embark on a perilous journey to unite five warring kingdoms before an ancient evil consumes the realm. With her loyal companion, a shape-shifting fox named Ember, and a mysterious warrior haunted by his past, Lyra faces impossible choices that will determine the fate of all Eldoria.',
    80  2, '2024-08-15 10:30:00', '2026-02-10 16:45:00'),
     75 'published', 2, '2024-08-15 10:30:00', '2026-02-10 16:45:00'),
    8176
    8277(TRUE,
     
    8580 'https://images.unsplash.com/photo-coffee-romance.jpg',
    8681 'Maya is a successful architect who has sworn off love after a devastating breakup. Damjan is a charming musician playing his guitar in Café Renaissance, drowning his own sorrows. When their eyes meet across the crowded café on a rainy October evening, neither expects that this chance encounter will turn their carefully constructed worlds upside down. As they navigate the complexities of trust, vulnerability, and second chances, they discover that sometimes the most beautiful things happen when you least expect them. Set against the vibrant backdrop of Skopje, this is a story about healing, passion, and finding love when you have stopped looking for it.',
    87  3, '2024-10-05 14:20:00', '2026-02-12 19:30:00'),
     82 'published', 3, '2024-10-05 14:20:00', '2026-02-12 19:30:00'),
    8883
    8984(TRUE,
     
    9287 'https://images.unsplash.com/photo-moonlight-vampire.jpg',
    9388 'For centuries, vampires and witches have been mortal enemies. But when a dark force threatens to destroy both supernatural communities, Daemon, the reluctant vampire prince, and Selene, a powerful witch with a tragic past, are forced into an uneasy alliance. As they work together to uncover ancient secrets and battle shadowy enemies, the forbidden attraction between them ignites into a passionate romance that could either save their worlds or doom them forever. In a race against time, they must decide: follow their hearts or fulfill their destinies?',
    94  6, '2024-11-20 11:00:00', '2026-02-11 21:15:00'),
     89 'published', 6, '2024-11-20 11:00:00', '2026-02-11 21:15:00'),
    9590
    9691(FALSE,
     
    9994 'https://images.unsplash.com/photo-princess-adventure.jpg',
    10095 'Princess Aria watched helplessly as her uncle murdered her family and seized the throne. Forced to flee in the dead of night, she disguises herself as a common thief and joins the notorious Shadow Wolves, a band of outlaws operating in the kingdom capital. As "Ari the street rat," she learns the art of survival, deception, and combat. But when she falls for the charismatic leader of the Shadow Wolves, who has his own reasons for hating the royal family, Aria must choose between revealing her true identity and losing his trust forever, or keeping her secret and watching her kingdom fall into tyranny.',
    101  2, '2025-01-10 09:45:00', '2026-02-13 10:20:00'),
     96 'published', 2, '2025-01-10 09:45:00', '2026-02-13 10:20:00'),
    10297
    10398(FALSE,
     
    106101 'https://images.unsplash.com/photo-ottoman-romance.jpg',
    107102 'In 1520 Constantinople, young scholar Iskender discovers a cache of love letters written by his grandmother, revealing a forbidden romance that spanned decades. As he reads her story of loving a Christian artist in a time of religious tensions, Iskender finds himself drawn to Elena, a Greek artist visiting the city. Their growing connection mirrors the passionate and dangerous love affair documented in the letters, forcing Iskender to confront whether history will repeat itself or if love can truly transcend the boundaries of faith, culture, and time.',
    108  3, '2025-02-01 13:15:00', '2026-02-13 15:50:00');
    109 
    110 
    111 INSERT INTO STATUS (story_id, status) VALUES
    112 (1, 'published'),
    113 (2, 'published'),
    114 (3, 'published'),
    115 (4, 'published'),
    116 (5, 'draft');
     103 'draft', 3, '2025-02-01 13:15:00', '2026-02-13 15:50:00');
     104
    117105
    118106INSERT INTO CHAPTER (chapter_number, chapter_name, title, chapter_content, word_count, rating, published_at, view_count, story_id, chapter_created_at, chapter_updated_at) VALUES
     
    146134(5, 2), (5, 8), (5, 5);
    147135
    148 INSERT INTO LIKES (user_id, story_id, like_created_at) VALUES
     136INSERT INTO LIKES (user_id, story_id, liked_at) VALUES
    149137(4, 1, '2024-08-16 10:20:00'),
    150138(4, 2, '2024-10-06 14:30:00'),
     
    195183(5, 3, '2025-01-05 16:00:00'), (5, 5, '2025-02-03 10:00:00');
    196184
    197 INSERT INTO NOTIFICATION (notification_content, is_read, recipient_user_id, type, link, notification_created_at) VALUES
    198 ('Sara liked your story "The Chronicles of Eldoria"',          TRUE,  2, 'like',         '/stories/1',           '2024-08-16 10:21:00'),
    199 ('Ivan commented on your story "The Chronicles of Eldoria"',   TRUE,  2, 'comment',      '/stories/1',           '2024-09-01 14:16:00'),
    200 ('Your story "The Stolen Crown" has reached 5,000 views!',     TRUE,  2, 'milestone',    '/stories/4',           '2025-01-25 09:00:00'),
    201 ('David added "The Chronicles of Eldoria" to their reading list', TRUE, 2, 'reading_list', '/stories/1',          '2024-10-01 16:31:00'),
    202 ('Sara liked your story "Falling for You"',                    TRUE,  3, 'like',         '/stories/2',           '2024-10-06 14:31:00'),
    203 ('Nikolina commented on your story "Falling for You"',         TRUE,  3, 'comment',      '/stories/2',           '2024-10-22 18:31:00'),
    204 ('Elena liked your story "Falling for You"',                   TRUE,  3, 'like',         '/stories/2',           '2024-10-07 10:31:00'),
    205 ('Your story "Falling for You" has been added to 2 reading lists', FALSE, 3, 'reading_list', '/stories/2',        '2024-11-15 10:00:00'),
    206 ('David liked your story "Moonlight Promises"',                TRUE,  6, 'like',         '/stories/3',           '2024-11-22 18:31:00'),
    207 ('Nikolina commented on your story "Moonlight Promises"',      TRUE,  6, 'comment',      '/stories/3',           '2024-11-28 21:01:00'),
    208 ('Your story "Moonlight Promises" has reached 7,000 views!',   FALSE, 6, 'milestone',    '/stories/3',           '2026-02-01 08:00:00'),
    209 ('Elena published a new chapter of "The Chronicles of Eldoria"', TRUE, 4, 'new_chapter',  '/stories/1/chapters/3','2024-08-25 18:01:00'),
    210 ('Marko published a new chapter of "Falling for You"',         TRUE,  4, 'new_chapter',  '/stories/2/chapters/3','2024-10-19 19:46:00'),
    211 ('Elena published a new story "The Stolen Crown"',             FALSE, 5, 'new_story',    '/stories/4',           '2025-01-10 09:46:00');
    212 
    213 INSERT INTO CONTENT_TYPE (notification_id, content_type) VALUES
    214 (1, 'like'), (2, 'comment'), (3, 'milestone'), (4, 'reading_list'),
    215 (5, 'like'), (6, 'comment'), (7, 'like'), (8, 'reading_list'),
    216 (9, 'like'), (10, 'comment'), (11, 'milestone'),
    217 (12, 'new_chapter'), (13, 'new_chapter'), (14, 'new_story');
    218 
    219 INSERT INTO NOTIFY (user_id, story_id, notification_id) VALUES
    220 (2, 1, 1),
    221 (2, 1, 2),
    222 (2, 4, 3),
    223 (2, 1, 4),
    224 (3, 2, 5),
    225 (3, 2, 6),
    226 (3, 2, 7),
    227 (3, 2, 8),
    228 (6, 3, 9),
    229 (6, 3, 10),
    230 (6, 3, 11),
    231 (4, 1, 12),
    232 (4, 2, 13),
    233 (5, 4, 14);
    234 
    235 INSERT INTO AI_SUGGESTION (original_text, suggested_text, accepted, suggestion_created_at, applied_at, story_id) VALUES
     185
     186INSERT INTO NOTIFICATION (notification_content, content_type, is_read, user_id, story_id, link, notification_created_at) VALUES
     187('Sara liked your story "The Chronicles of Eldoria"',             'like',         TRUE,  2, 1, '/stories/1',            '2024-08-16 10:21:00'),
     188('Ivan commented on your story "The Chronicles of Eldoria"',      'comment',      TRUE,  2, 1, '/stories/1',            '2024-09-01 14:16:00'),
     189('Your story "The Stolen Crown" has reached 5,000 views!',        'milestone',    TRUE,  2, 4, '/stories/4',            '2025-01-25 09:00:00'),
     190('David added "The Chronicles of Eldoria" to their reading list', 'reading_list', TRUE,  2, 1, '/stories/1',            '2024-10-01 16:31:00'),
     191('Sara liked your story "Falling for You"',                       'like',         TRUE,  3, 2, '/stories/2',            '2024-10-06 14:31:00'),
     192('Nikolina commented on your story "Falling for You"',            'comment',      TRUE,  3, 2, '/stories/2',            '2024-10-22 18:31:00'),
     193('Elena liked your story "Falling for You"',                      'like',         TRUE,  3, 2, '/stories/2',            '2024-10-07 10:31:00'),
     194('Your story "Falling for You" has been added to 2 reading lists','reading_list', FALSE, 3, 2, '/stories/2',            '2024-11-15 10:00:00'),
     195('David liked your story "Moonlight Promises"',                   'like',         TRUE,  6, 3, '/stories/3',            '2024-11-22 18:31:00'),
     196('Nikolina commented on your story "Moonlight Promises"',         'comment',      TRUE,  6, 3, '/stories/3',            '2024-11-28 21:01:00'),
     197('Your story "Moonlight Promises" has reached 7,000 views!',      'milestone',    FALSE, 6, 3, '/stories/3',            '2026-02-01 08:00:00'),
     198('Elena published a new chapter of "The Chronicles of Eldoria"',  'new_chapter',  TRUE,  4, 1, '/stories/1/chapters/3', '2024-08-25 18:01:00'),
     199('Marko published a new chapter of "Falling for You"',            'new_chapter',  TRUE,  4, 2, '/stories/2/chapters/3', '2024-10-19 19:46:00'),
     200('Elena published a new story "The Stolen Crown"',                'new_story',    FALSE, 5, 4, '/stories/4',            '2025-01-10 09:46:00');
     201
     202
     203INSERT INTO AI_SUGGESTION (original_text, suggested_text, suggestion_type, accepted, suggestion_created_at, applied_at, story_id) VALUES
    236204('Lyra ran through the forest, she was scared and tired.',
    237205 'Lyra sprinted through the dense forest, her heart pounding with fear, exhaustion weighing down each desperate step.',
    238  TRUE, '2024-08-19 10:00:00', '2024-08-19 10:15:00', 1),
    239 
    240 ('The dragon was big and had red scales.', 
     206 'style', TRUE, '2024-08-19 10:00:00', '2024-08-19 10:15:00', 1),
     207
     208('The dragon was big and had red scales.',
    241209 'The dragon towered above them, its massive form covered in crimson scales that shimmered like molten rubies in the firelight.',
    242  TRUE, '2024-08-22 14:30:00', '2024-08-22 14:45:00', 1),
     210 'style', TRUE, '2024-08-22 14:30:00', '2024-08-22 14:45:00', 1),
    243211
    244212('Kael looked at her with a serious expression.',
    245213 'Kael''s gaze locked onto hers, his storm-gray eyes betraying a mix of duty and something deeper—something dangerous.',
    246  FALSE, '2024-08-24 16:00:00', NULL, 1),
     214 'style', FALSE, '2024-08-24 16:00:00', NULL, 1),
    247215
    248216('Maya felt sad when she thought about her ex-boyfriend.',
    249217 'A wave of melancholy washed over Maya whenever Aleksandar''s memory surfaced, the ache of betrayal still fresh despite the passing months.',
    250  TRUE, '2024-10-08 11:00:00', '2024-10-08 11:20:00', 2),
     218 'style', TRUE, '2024-10-08 11:00:00', '2024-10-08 11:20:00', 2),
    251219
    252220('Damjan played the guitar very well.',
    253221 'Damjan''s fingers danced across the guitar strings with practiced grace, coaxing melodies that seemed to speak directly to the soul.',
    254  TRUE, '2024-10-15 13:45:00', '2024-10-15 14:00:00', 2),
     222 'style', TRUE, '2024-10-15 13:45:00', '2024-10-15 14:00:00', 2),
    255223
    256224('The vampire and witch did not trust each other.',
    257225 'Centuries of bloodshed and betrayal stood between them, making trust not just difficult—but seemingly impossible.',
    258  TRUE, '2024-11-25 15:30:00', '2024-11-25 15:50:00', 3);
    259 
    260 INSERT INTO SUGGESTION_TYPE (suggestion_id, suggestion_type) VALUES
    261 (1, 'style'), (1, 'grammar'),
    262 (2, 'style'),
    263 (3, 'style'),
    264 (4, 'style'),
    265 (5, 'style'),
    266 (6, 'pacing');
     226 'pacing', TRUE, '2024-11-25 15:30:00', '2024-11-25 15:50:00', 3);
    267227
    268228INSERT INTO NEED_APPROVAL (suggestion_id, story_id, chapter_id) VALUES
     
    274234(6, 3, 7);
    275235
    276 INSERT INTO COLLABORATION (user_id, story_id, collab_created_at) VALUES
    277 (3, 5, '2025-02-01 13:15:00'),
    278 (9, 5, '2025-02-02 10:00:00');
    279 
    280 INSERT INTO ROLES (user_id, story_id, roles) VALUES
    281 (3, 5, 'lead-author'),
    282 (9, 5, 'co-author');
    283 
    284 INSERT INTO PERMISSION_LEVEL (user_id, story_id, permission_level) VALUES
    285 (3, 5, 5),
    286 (9, 5, 4);
     236
     237INSERT INTO COLLABORATION (user_id, story_id, role, permission_level, collab_created_at) VALUES
     238(3, 5, 'lead-author', 5, '2025-02-01 13:15:00'),
     239(9, 5, 'co-author',   4, '2025-02-02 10:00:00');
    287240}}}