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:
parent
3222078e6e
commit
5ebad3be0a
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue