A platform for community discussion. Free, open, simple.
Revert "DEV: Re-add polymorphic bookmark columns (#16245)" (#16246)
Alan Guo Xiang Tan4e6f7a1a6e67
diff --git a/app/models/bookmark.rb b/app/models/bookmark.rbindex 35363b60d7e..e2f413bf13b 100644--- a/app/models/bookmark.rb+++ b/app/models/bookmark.rb@@ -4,6 +4,8 @@ class Bookmark < ActiveRecord::Base# these columns were here for a very short amount of time,# hence the very short ignore timeself.ignored_columns = [+ "bookmarkable_id", # TODO 2022-04-01 remove+ "bookmarkable_type", # TODO 2022-04-01 remove"topic_id", # TODO 2022-04-01: remove"reminder_type" # TODO 2021-04-01: remove]@@ -179,12 +181,9 @@ end# auto_delete_preference :integer default(0), not null# pinned :boolean default(FALSE)# for_topic :boolean default(FALSE), not null-# bookmarkable_id :integer-# bookmarkable_type :string## Indexes#-# idx_bookmarks_user_polymorphic_unique (user_id,bookmarkable_type,bookmarkable_id) UNIQUE# index_bookmarks_on_post_id (post_id)# index_bookmarks_on_reminder_at (reminder_at)# index_bookmarks_on_reminder_set_at (reminder_set_at)diff --git a/db/migrate/20220322024216_add_bookmark_polymorphic_columns_again.rb b/db/migrate/20220322024216_add_bookmark_polymorphic_columns_again.rbdeleted file mode 100644index 0f4727f41e6..00000000000--- a/db/migrate/20220322024216_add_bookmark_polymorphic_columns_again.rb+++ /dev/null@@ -1,10 +0,0 @@-# frozen_string_literal: true--class AddBookmarkPolymorphicColumnsAgain < ActiveRecord::Migration[6.1]- def change- add_column :bookmarks, :bookmarkable_id, :integer- add_column :bookmarks, :bookmarkable_type, :string-- add_index :bookmarks, [:user_id, :bookmarkable_type, :bookmarkable_id], name: "idx_bookmarks_user_polymorphic_unique", unique: true- end-end