A platform for community discussion. Free, open, simple.
FIX: Restrict duplicate timings from being moved with posts (#30311)
Gary Pendergastc2f7da329851
diff --git a/app/models/post_mover.rb b/app/models/post_mover.rbindex 17c116ae80d..1f69c8aa96a 100644--- a/app/models/post_mover.rb+++ b/app/models/post_mover.rb@@ -478,7 +478,9 @@ class PostMoverdef copy_shifted_post_timings_from_tempDB.exec <<~SQLINSERT INTO post_timings (topic_id, user_id, post_number, msecs)- SELECT DISTINCT topic_id, user_id, post_number, msecs FROM temp_post_timings+ SELECT DISTINCT ON (topic_id, post_number, user_id) topic_id, user_id, post_number, msecs+ FROM temp_post_timings+ ORDER BY topic_id, post_number, user_id, msecs DESCON CONFLICT (topic_id, post_number, user_id) DO UPDATESET msecs = GREATEST(post_timings.msecs, excluded.msecs)SQL