Corrected `reply_to_user_id` to reference original posters ID instead of itself. (#25307)
This commit is contained in:
parent
610d5b45c7
commit
0c0f486647
|
@ -364,10 +364,10 @@ def update_posts
|
||||||
|
|
||||||
DB.exec <<~SQL
|
DB.exec <<~SQL
|
||||||
UPDATE posts AS replies
|
UPDATE posts AS replies
|
||||||
SET reply_to_user_id = replies.user_id
|
SET reply_to_user_id = original.user_id
|
||||||
FROM posts
|
FROM posts AS original
|
||||||
WHERE posts.topic_id = replies.topic_id
|
WHERE original.topic_id = replies.topic_id
|
||||||
AND posts.post_number = replies.reply_to_post_number
|
AND original.post_number = replies.reply_to_post_number
|
||||||
AND replies.reply_to_post_number IS NOT NULL
|
AND replies.reply_to_post_number IS NOT NULL
|
||||||
AND replies.reply_to_user_id IS NULL
|
AND replies.reply_to_user_id IS NULL
|
||||||
AND replies.post_number <> replies.reply_to_post_number
|
AND replies.post_number <> replies.reply_to_post_number
|
||||||
|
|
Loading…
Reference in New Issue