mirror of
https://github.com/discourse/discourse.git
synced 2025-04-02 05:19:43 +08:00
FIX: Further refine duplicate bookmark delete query (#16931)
In f00e28206727da7a80d7a415cf825e746fd8d186 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
|
INNER JOIN posts ON bookmarks.post_id = posts.id
|
||||||
WHERE bookmarks.for_topic
|
WHERE bookmarks.for_topic
|
||||||
GROUP BY (bookmarks.user_id, posts.topic_id)
|
GROUP BY (bookmarks.user_id, posts.topic_id)
|
||||||
)
|
) AND bookmarks.for_topic
|
||||||
SQL
|
SQL
|
||||||
|
|
||||||
DB.exec(<<~SQL)
|
DB.exec(<<~SQL)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user