Changes between Version 1 and Version 2 of dmlScript.sql
- Timestamp:
- 03/03/26 23:57:19 (3 weeks ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
dmlScript.sql
v1 v2 1 1 {{{#!sql 2 TRUNCATE TABLE NEED_APPROVAL CASCADE; 3 TRUNCATE TABLE NOTIFY CASCADE; 2 4 TRUNCATE TABLE READING_LIST_ITEMS CASCADE; 3 5 TRUNCATE TABLE HAS_GENRE CASCADE; … … 50 52 (10); 51 53 52 INSERT INTO WRITER (user_id, created_story) VALUES 53 (2, TRUE), 54 (3, TRUE), 55 (6, TRUE), 56 (8, FALSE), 57 (9, TRUE); 58 54 INSERT INTO WRITER (user_id) VALUES 55 (2), 56 (3), 57 (6), 58 (8), 59 (9); 59 60 60 61 INSERT INTO GENRE (name) VALUES … … 75 76 'https://images.unsplash.com/photo-dragon-fantasy.jpg', 76 77 '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.', 77 2, 78 '2024-08-15 10:30:00', 79 '2026-02-10 16:45:00'), 78 2, '2024-08-15 10:30:00', '2026-02-10 16:45:00'), 80 79 81 80 (TRUE, … … 83 82 'https://images.unsplash.com/photo-coffee-romance.jpg', 84 83 '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.', 85 3, 86 '2024-10-05 14:20:00', 87 '2026-02-12 19:30:00'), 84 3, '2024-10-05 14:20:00', '2026-02-12 19:30:00'), 88 85 89 86 (TRUE, … … 91 88 'https://images.unsplash.com/photo-moonlight-vampire.jpg', 92 89 '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?', 93 6, 94 '2024-11-20 11:00:00', 95 '2026-02-11 21:15:00'), 90 6, '2024-11-20 11:00:00', '2026-02-11 21:15:00'), 96 91 97 92 (FALSE, … … 99 94 'https://images.unsplash.com/photo-princess-adventure.jpg', 100 95 '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, 102 '2025-01-10 09:45:00', 103 '2026-02-13 10:20:00'), 96 2, '2025-01-10 09:45:00', '2026-02-13 10:20:00'), 104 97 105 98 (FALSE, … … 107 100 'https://images.unsplash.com/photo-ottoman-romance.jpg', 108 101 '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.', 109 3, 110 '2025-02-01 13:15:00', 111 '2026-02-13 15:50:00'); 112 102 3, '2025-02-01 13:15:00', '2026-02-13 15:50:00'); 113 103 114 104 INSERT INTO STATUS (story_id, status) VALUES … … 118 108 (4, 'published'), 119 109 (5, 'draft'); 110 120 111 INSERT INTO CHAPTER (chapter_number, chapter_name, title, content, word_count, rating, published_at, view_count, story_id, created_at, updated_at) VALUES 121 112 (1, 'Prologue', 'The Awakening', 'The ground trembled beneath the Crystal Mountains. For a thousand years, the last dragon had slept, bound by ancient magic and forgotten prophecies. But tonight, as three moons aligned in the crimson sky, the seals began to crack. Deep within her chamber, Lyra shot upright in bed, her mark burning with an intensity she had never felt before. The mark of the Dragon Keeper, dormant since birth, now glowed with ethereal fire. She knew, with absolute certainty, that everything was about to change. The dragon was waking, and with it, an age of magic and war would return to Eldoria...', 3200, 4.8, '2024-08-15 11:00:00', 15420, 1, '2024-08-15 10:30:00', '2024-08-15 10:30:00'), … … 140 131 141 132 (1, 'Prologue', 'The Letters', 'Iskender''s grandmother had been dead for three months when he found the letters. Hidden in a false bottom of her jewelry box, wrapped in faded silk, were dozens of letters written in both Turkish and Greek. As he carefully unfolded the first one, dated 1520, his breath caught. "My beloved Nikos," it began. "I know this letter can never reach you, but I write anyway. They have forbidden me from seeing you. My father says you are the enemy, that our love is impossible. But how can love be the enemy? How can two hearts beating as one be anything but divine?" Iskender read through the night, discovering a grandmother he never knew—young, passionate, defiant. And as dawn broke over modern Istanbul, he made a decision. He would find Nikos''s story. He would understand their love. He never expected to find his own...', 3600, 4.5, '2025-02-01 13:30:00', 3890, 5, '2025-02-01 13:15:00', '2025-02-01 13:15:00'); 133 142 134 INSERT INTO HAS_GENRE (story_id, genre_id) VALUES 143 (1, 1), 144 (1, 4), 145 (1, 6), 146 147 148 (2, 2), 149 (2, 9), 150 (2, 5), 151 152 (3, 2), 153 (3, 7), 154 (3, 1), 155 156 157 (4, 1), 158 (4, 4), 159 (4, 2), 160 161 (5, 2), 162 (5, 8), 163 (5, 5); 135 (1, 1), (1, 4), (1, 6), 136 (2, 2), (2, 9), (2, 5), 137 (3, 2), (3, 7), (3, 1), 138 (4, 1), (4, 4), (4, 2), 139 (5, 2), (5, 8), (5, 5); 164 140 165 141 INSERT INTO LIKES (user_id, story_id, created_at) VALUES 166 167 142 (4, 1, '2024-08-16 10:20:00'), 168 143 (4, 2, '2024-10-06 14:30:00'), 169 144 (4, 3, '2024-11-21 16:45:00'), 170 171 145 (5, 1, '2024-08-17 11:15:00'), 172 146 (5, 4, '2025-01-11 12:30:00'), 173 174 147 (7, 1, '2024-08-18 09:00:00'), 175 148 (7, 2, '2024-10-08 15:20:00'), 176 149 (7, 3, '2024-11-22 18:30:00'), 177 150 (7, 4, '2025-01-12 10:45:00'), 178 179 151 (10, 2, '2024-10-09 16:00:00'), 180 152 (10, 3, '2024-11-23 19:15:00'), 181 153 (10, 5, '2025-02-02 11:20:00'), 182 183 154 (2, 2, '2024-10-07 10:30:00'), 184 155 (2, 3, '2024-11-21 12:00:00'), … … 188 159 (6, 2, '2024-10-10 17:30:00'); 189 160 190 191 161 INSERT INTO COMMENT (content, user_id, story_id, created_at, updated_at) VALUES 192 ('This is absolutely breathtaking! The world-building is incredible. I cannot wait to see what happens next with Lyra and Kael!', 193 4, 1, '2024-08-26 12:30:00', '2024-08-26 12:30:00'), 194 195 ('Finally a fantasy story where the female lead is strong without losing her vulnerability. Ember is my favorite character so far!', 196 5, 1, '2024-09-01 14:15:00', '2024-09-01 14:15:00'), 197 198 ('The prophecy is so well crafted. I have theories about what the "five kingdoms united" actually means... cannot wait for chapter 4!', 199 7, 1, '2024-09-10 16:45:00', '2024-09-10 16:45:00'), 200 201 ('I ugly cried reading chapter 3. This hits so close to home. Maya and Damjan feel so REAL.', 202 4, 2, '2024-10-20 10:20:00', '2024-10-20 10:20:00'), 203 204 ('As someone from Skopje, I love the local references! The Café Renaissance detail is perfect!', 205 10, 2, '2024-10-22 18:30:00', '2024-10-22 18:30:00'), 206 207 ('This is now my comfort story. The slow burn is killing me but in the best way possible!', 208 4, 2, '2024-11-05 20:15:00', '2024-11-05 20:15:00'), 209 210 ('Daemon and Selene have the best chemistry I have read in YEARS. The forbidden enemies-to-lovers trope done RIGHT!', 211 10, 3, '2024-11-28 21:00:00', '2024-11-28 21:00:00'), 212 213 ('The world-building is amazing. I love how you have given depth to both vampire and witch societies instead of making them one-dimensional.', 214 7, 3, '2024-12-05 15:30:00', '2024-12-05 15:30:00'), 215 216 ('Aria is such a badass! From princess to thief? This is the character arc I needed!', 217 5, 4, '2025-01-18 11:45:00', '2025-01-18 11:45:00'), 218 219 ('The tension between Aria and Flynn is electric! Please tell me they will end up together?!', 220 4, 4, '2025-01-20 14:20:00', '2025-01-20 14:20:00'), 221 222 ('The dual timeline narrative is beautiful. I am equally invested in both love stories!', 223 10, 5, '2025-02-03 16:30:00', '2025-02-03 16:30:00'); 224 162 ('This is absolutely breathtaking! The world-building is incredible. I cannot wait to see what happens next with Lyra and Kael!', 4, 1, '2024-08-26 12:30:00', '2024-08-26 12:30:00'), 163 ('Finally a fantasy story where the female lead is strong without losing her vulnerability. Ember is my favorite character so far!', 5, 1, '2024-09-01 14:15:00', '2024-09-01 14:15:00'), 164 ('The prophecy is so well crafted. I have theories about what the "five kingdoms united" actually means... cannot wait for chapter 4!', 7, 1, '2024-09-10 16:45:00', '2024-09-10 16:45:00'), 165 ('I ugly cried reading chapter 3. This hits so close to home. Maya and Damjan feel so REAL.', 4, 2, '2024-10-20 10:20:00', '2024-10-20 10:20:00'), 166 ('As someone from Skopje, I love the local references! The Café Renaissance detail is perfect!', 10, 2, '2024-10-22 18:30:00', '2024-10-22 18:30:00'), 167 ('This is now my comfort story. The slow burn is killing me but in the best way possible!', 7, 2, '2024-11-05 20:15:00', '2024-11-05 20:15:00'), 168 ('Daemon and Selene have the best chemistry I have read in YEARS. The forbidden enemies-to-lovers trope done RIGHT!', 4, 3, '2024-11-28 21:00:00', '2024-11-28 21:00:00'), 169 ('The world-building is amazing. I love how you have given depth to both vampire and witch societies instead of making them one-dimensional.', 10, 3, '2024-12-05 15:30:00', '2024-12-05 15:30:00'), 170 ('Aria is such a badass! From princess to thief? This is the character arc I needed!', 5, 4, '2025-01-18 11:45:00', '2025-01-18 11:45:00'), 171 ('The tension between Aria and Flynn is electric! Please tell me they will end up together?!', 7, 4, '2025-01-20 14:20:00', '2025-01-20 14:20:00'), 172 ('The dual timeline narrative is beautiful. I am equally invested in both love stories!', 10, 5, '2025-02-03 16:30:00', '2025-02-03 16:30:00'); 225 173 226 174 INSERT INTO READING_LIST (name, content, is_public, user_id) VALUES … … 232 180 233 181 INSERT INTO READING_LIST_ITEMS (list_id, story_id, added_at) VALUES 234 (1, 1, '2024-09-01 10:30:00'), 235 (1, 4, '2025-01-14 12:00:00'), 236 237 (2, 1, '2024-09-15 15:00:00'), 238 (2, 4, '2025-01-15 10:30:00'), 239 240 (3, 1, '2024-10-01 16:30:00'), 241 (3, 2, '2024-10-08 17:00:00'), 242 (3, 3, '2024-11-22 19:00:00'), 243 (3, 4, '2025-01-13 11:00:00'), 244 245 (4, 2, '2024-11-10 12:30:00'), 246 (4, 3, '2024-11-23 20:00:00'), 182 (1, 1, '2024-09-01 10:30:00'), (1, 4, '2025-01-14 12:00:00'), 183 (2, 1, '2024-09-15 15:00:00'), (2, 4, '2025-01-15 10:30:00'), 184 (3, 1, '2024-10-01 16:30:00'), (3, 2, '2024-10-08 17:00:00'), 185 (3, 3, '2024-11-22 19:00:00'), (3, 4, '2025-01-13 11:00:00'), 186 (4, 2, '2024-11-10 12:30:00'), (4, 3, '2024-11-23 20:00:00'), 247 187 (4, 5, '2025-02-02 12:00:00'), 248 249 (5, 3, '2025-01-05 16:00:00'), 250 (5, 5, '2025-02-03 10:00:00'); 251 252 INSERT INTO NOTIFICATION (content, is_read, user_id, created_at) VALUES 253 ('Sara liked your story "The Chronicles of Eldoria"', TRUE, 2, '2024-08-16 10:21:00'), 254 ('Ivan commented on your story "The Chronicles of Eldoria"', TRUE, 2, '2024-09-01 14:16:00'), 255 ('Your story "The Stolen Crown" has reached 5,000 views!', TRUE, 2, '2025-01-25 09:00:00'), 256 ('David added "The Chronicles of Eldoria" to their reading list', TRUE, 2, '2024-10-01 16:31:00'), 257 258 ('Sara liked your story "Falling for You"', TRUE, 3, '2024-10-06 14:31:00'), 259 ('Nikolina commented on your story "Falling for You"', TRUE, 3, '2024-10-22 18:31:00'), 260 ('Elena liked your story "Falling for You"', TRUE, 3, '2024-10-07 10:31:00'), 261 ('Your story "Falling for You" has been added to 2 reading lists', FALSE, 3, '2024-11-15 10:00:00'), 262 263 ('David liked your story "Moonlight Promises"', TRUE, 6, '2024-11-22 18:31:00'), 264 ('Nikolina commented on your story "Moonlight Promises"', TRUE, 6, '2024-11-28 21:01:00'), 265 ('Your story "Moonlight Promises" has reached 7,000 views!', FALSE, 6, '2026-02-01 08:00:00'), 266 267 ('Elena published a new chapter of "The Chronicles of Eldoria"', TRUE, 4, '2024-08-25 18:01:00'), 268 ('Marko published a new chapter of "Falling for You"', TRUE, 4, '2024-10-19 19:46:00'), 269 ('Elena published a new story "The Stolen Crown"', FALSE, 5, '2025-01-10 09:46:00'); 188 (5, 3, '2025-01-05 16:00:00'), (5, 5, '2025-02-03 10:00:00'); 189 190 INSERT INTO NOTIFICATION (content, is_read, created_at) VALUES 191 ('Sara liked your story "The Chronicles of Eldoria"', TRUE, '2024-08-16 10:21:00'), 192 ('Ivan commented on your story "The Chronicles of Eldoria"', TRUE, '2024-09-01 14:16:00'), 193 ('Your story "The Stolen Crown" has reached 5,000 views!', TRUE, '2025-01-25 09:00:00'), 194 ('David added "The Chronicles of Eldoria" to their reading list', TRUE, '2024-10-01 16:31:00'), 195 ('Sara liked your story "Falling for You"', TRUE, '2024-10-06 14:31:00'), 196 ('Nikolina commented on your story "Falling for You"', TRUE, '2024-10-22 18:31:00'), 197 ('Elena liked your story "Falling for You"', TRUE, '2024-10-07 10:31:00'), 198 ('Your story "Falling for You" has been added to 2 reading lists', FALSE, '2024-11-15 10:00:00'), 199 ('David liked your story "Moonlight Promises"', TRUE, '2024-11-22 18:31:00'), 200 ('Nikolina commented on your story "Moonlight Promises"', TRUE, '2024-11-28 21:01:00'), 201 ('Your story "Moonlight Promises" has reached 7,000 views!', FALSE, '2026-02-01 08:00:00'), 202 ('Elena published a new chapter of "The Chronicles of Eldoria"', TRUE, '2024-08-25 18:01:00'), 203 ('Marko published a new chapter of "Falling for You"', TRUE, '2024-10-19 19:46:00'), 204 ('Elena published a new story "The Stolen Crown"', FALSE, '2025-01-10 09:46:00'); 270 205 271 206 INSERT INTO CONTENT_TYPE (notification_id, content_type) VALUES 272 (1, 'like'), 273 (2, 'comment'), 274 (3, 'milestone'), 275 (4, 'reading_list'), 276 (5, 'like'), 277 (6, 'comment'), 278 (7, 'like'), 279 (8, 'reading_list'), 280 (9, 'like'), 281 (10, 'comment'), 282 (11, 'milestone'), 283 (12, 'new_chapter'), 284 (13, 'new_chapter'), 285 (14, 'new_story'); 286 287 INSERT INTO AI_SUGGESTION (original_text, suggested_text, accepted, story_id, created_at, applied_at) VALUES 207 (1, 'like'), (2, 'comment'), (3, 'milestone'), (4, 'reading_list'), 208 (5, 'like'), (6, 'comment'), (7, 'like'), (8, 'reading_list'), 209 (9, 'like'), (10, 'comment'), (11, 'milestone'), 210 (12, 'new_chapter'), (13, 'new_chapter'), (14, 'new_story'); 211 212 INSERT INTO NOTIFY (user_id, story_id, notification_id) VALUES 213 (2, 1, 1), 214 (2, 1, 2), 215 (2, 4, 3), 216 (2, 1, 4), 217 (3, 2, 5), 218 (3, 2, 6), 219 (3, 2, 7), 220 (3, 2, 8), 221 (6, 3, 9), 222 (6, 3, 10), 223 (6, 3, 11), 224 (4, 1, 12), 225 (4, 2, 13), 226 (5, 4, 14); 227 228 INSERT INTO AI_SUGGESTION (original_text, suggested_text, accepted, created_at, applied_at, story_id) VALUES 288 229 ('Lyra ran through the forest, she was scared and tired.', 289 230 'Lyra sprinted through the dense forest, her heart pounding with fear, exhaustion weighing down each desperate step.', 290 TRUE, 1, '2024-08-19 10:00:00', '2024-08-19 10:15:00'),231 TRUE, '2024-08-19 10:00:00', '2024-08-19 10:15:00', 1), 291 232 292 233 ('The dragon was big and had red scales.', 293 234 'The dragon towered above them, its massive form covered in crimson scales that shimmered like molten rubies in the firelight.', 294 TRUE, 1, '2024-08-22 14:30:00', '2024-08-22 14:45:00'),235 TRUE, '2024-08-22 14:30:00', '2024-08-22 14:45:00', 1), 295 236 296 237 ('Kael looked at her with a serious expression.', 297 238 'Kael''s gaze locked onto hers, his storm-gray eyes betraying a mix of duty and something deeper—something dangerous.', 298 FALSE, 1, '2024-08-24 16:00:00', NULL),239 FALSE, '2024-08-24 16:00:00', NULL, 1), 299 240 300 241 ('Maya felt sad when she thought about her ex-boyfriend.', 301 242 'A wave of melancholy washed over Maya whenever Aleksandar''s memory surfaced, the ache of betrayal still fresh despite the passing months.', 302 TRUE, 2, '2024-10-08 11:00:00', '2024-10-08 11:20:00'),243 TRUE, '2024-10-08 11:00:00', '2024-10-08 11:20:00', 2), 303 244 304 245 ('Damjan played the guitar very well.', 305 246 'Damjan''s fingers danced across the guitar strings with practiced grace, coaxing melodies that seemed to speak directly to the soul.', 306 TRUE, 2, '2024-10-15 13:45:00', '2024-10-15 14:00:00'),247 TRUE, '2024-10-15 13:45:00', '2024-10-15 14:00:00', 2), 307 248 308 249 ('The vampire and witch did not trust each other.', 309 250 'Centuries of bloodshed and betrayal stood between them, making trust not just difficult—but seemingly impossible.', 310 TRUE, 3, '2024-11-25 15:30:00', '2024-11-25 15:50:00');251 TRUE, '2024-11-25 15:30:00', '2024-11-25 15:50:00', 3); 311 252 312 253 INSERT INTO SUGGESTION_TYPE (suggestion_id, suggestion_type) VALUES 313 (1, 'style'), 314 (1, 'grammar'), 254 (1, 'style'), (1, 'grammar'), 315 255 (2, 'style'), 316 256 (3, 'style'), … … 319 259 (6, 'pacing'); 320 260 261 INSERT INTO NEED_APPROVAL (suggestion_id, story_id, chapter_id) VALUES 262 (1, 1, 1), 263 (2, 1, 2), 264 (3, 1, 3), 265 (4, 2, 4), 266 (5, 2, 5), 267 (6, 3, 7); 268 321 269 INSERT INTO COLLABORATION (user_id, story_id, created_at) VALUES 322 270 (3, 5, '2025-02-01 13:15:00'),
