mirror of
https://github.com/discourse/discourse.git
synced 2024-12-04 08:23:45 +08:00
11 lines
367 B
Ruby
11 lines
367 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
class AddBookmarkPolymorphicColumns < 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
|