Corrected reply_to_user_id to reference original posters ID instead of itself. (#25307)

This commit is contained in:
Ruben Oussoren 2024-01-18 09:02:45 -05:00 committed by GitHub
parent 610d5b45c7
commit 0c0f486647
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -364,10 +364,10 @@ def update_posts
DB.exec <<~SQL
UPDATE posts AS replies
SET reply_to_user_id = replies.user_id
FROM posts
WHERE posts.topic_id = replies.topic_id
AND posts.post_number = replies.reply_to_post_number
SET reply_to_user_id = original.user_id
FROM posts AS original
WHERE original.topic_id = replies.topic_id
AND original.post_number = replies.reply_to_post_number
AND replies.reply_to_post_number IS NOT NULL
AND replies.reply_to_user_id IS NULL
AND replies.post_number <> replies.reply_to_post_number