FIX: Further refine duplicate bookmark delete query (#16931)

In f00e282067 we added this
DELETE query to delete duplicate for_topic bookmarks, we
just need this further refinement to the WHERE clause to
avoid deleting post bookmarks.
This commit is contained in:
Martin Brennan 2022-05-27 08:22:23 +10:00 committed by GitHub
parent 3222078e6e
commit 5ebad3be0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -22,7 +22,7 @@ class BackfillPolymorphicBookmarksAndMakeDefault < ActiveRecord::Migration[7.0]
INNER JOIN posts ON bookmarks.post_id = posts.id
WHERE bookmarks.for_topic
GROUP BY (bookmarks.user_id, posts.topic_id)
)
) AND bookmarks.for_topic
SQL
DB.exec(<<~SQL)