diff --git a/db/migrate/20220512011522_backfill_polymorphic_bookmarks_and_make_default.rb b/db/migrate/20220512011522_backfill_polymorphic_bookmarks_and_make_default.rb index d3f5806c4a6..a1c830e23e9 100644 --- a/db/migrate/20220512011522_backfill_polymorphic_bookmarks_and_make_default.rb +++ b/db/migrate/20220512011522_backfill_polymorphic_bookmarks_and_make_default.rb @@ -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)