Orphaned comment photos improvement #42

Closed
opened 2024-05-17 16:57:41 +00:00 by noah · 0 comments
Owner

The orphaned comment photos worker finds and cleans up comment_photos having a NULL comment_id but it could also remove ones where the associated comment had gone away:

select * from comment_photos
where not exists (
    select 1 from comments
    where comment_photos.comment_id=comments.id
);

Repro steps: have a forum thread with many comments with pictures attached, and then delete the OP; it removes all the comments but leaves orphaned comment_photos.

The orphaned comment photos worker finds and cleans up comment_photos having a NULL comment_id but it could also remove ones where the associated comment had gone away: ```sql select * from comment_photos where not exists ( select 1 from comments where comment_photos.comment_id=comments.id ); ``` Repro steps: have a forum thread with many comments with pictures attached, and then delete the OP; it removes all the comments but leaves orphaned comment_photos.
noah added the
enhancement
label 2024-05-17 16:57:41 +00:00
noah closed this issue 2024-09-28 00:06:58 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: nonshy/website#42
No description provided.