Changes between Version 1 and Version 2 of AdminRemovesAStory
- Timestamp:
- 08/24/26 16:20:41 (13 days ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AdminRemovesAStory
v1 v2 2 2 3 3 === Actor: **Admin** 4 4 5 An admin removes an inappropriate published story from the platform after reviewing it for content violations. 5 6 … … 9 10 {{{#!sql 10 11 SELECT s.story_id, s.short_description, s.mature_content, 11 u.username AS author, s t.status,12 u.username AS author, s.status, 12 13 COUNT(DISTINCT c.comment_id) AS total_comments, 13 s. created_at14 s.story_created_at 14 15 FROM STORY s 15 16 JOIN USERS u ON s.user_id = u.user_id 16 JOIN STATUS st ON s.story_id = st.story_id17 17 LEFT JOIN COMMENT c ON s.story_id = c.story_id 18 WHERE s t.status = 'published'19 GROUP BY s.story_id, u.username, s t.status20 ORDER BY s. created_at DESC;18 WHERE s.status = 'published' 19 GROUP BY s.story_id, u.username, s.status 20 ORDER BY s.story_created_at DESC; 21 21 }}} 22 22 … … 25 25 **4.** The admin confirms the story violates platform rules and proceeds to delete it. 26 26 27 **5.** The system deletes the story, and all related records are automatically removed via CASCADE. 27 **5.** The system notifies the writer that their story is being removed due to a policy violation, before the story record is deleted. 28 {{{#!sql 29 INSERT INTO NOTIFICATION (notification_content, content_type, is_read, user_id, story_id, notification_created_at) 30 VALUES ('Your story "Moonlight Promises" has been removed by an administrator due to a content policy violation.', 'story_removed', FALSE, 6, 3, CURRENT_TIMESTAMP); 31 }}} 32 33 **6.** The system deletes the story, and all related records (chapters, comments, likes, collaborations, genre links, reading list entries) are automatically removed via CASCADE. 28 34 {{{#!sql 29 35 DELETE FROM STORY … … 31 37 }}} 32 38 33 **6.** The system notifies the writer that their story was removed due to a policy violation.34 {{{#!sql35 INSERT INTO NOTIFICATION (content, is_read, created_at)36 VALUES ('Your story "Moonlight Promises" has been removed by an administrator due to a content policy violation.', FALSE, CURRENT_TIMESTAMP);37 }}}38 39 39 **7.** The system logs the action and confirms the story is no longer visible on the platform.
