Revert "DEV: Re-add polymorphic bookmark columns (#16245)" (#16246)

This reverts commit 2f1ddadff7.
This commit is contained in:
Alan Guo Xiang Tan 2022-03-22 13:13:42 +08:00 committed by GitHub
parent 2f1ddadff7
commit 4e6f7a1a6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 13 deletions

View File

@ -4,6 +4,8 @@ class Bookmark < ActiveRecord::Base
# these columns were here for a very short amount of time,
# hence the very short ignore time
self.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)

View File

@ -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