gab-social/db/migrate/20200801023518__create_group_pinned_statuses.rb
mgabdev 0c2b6fb112 Added migration for CreateGroupPinnedStatuses
• Added:
- migration for CreateGroupPinnedStatuses
2020-08-06 00:24:12 -05:00

13 lines
427 B
Ruby

class CreateGroupPinnedStatuses < ActiveRecord::Migration[5.2]
disable_ddl_transaction!
def change
create_table :group_pinned_statuses do |t|
t.belongs_to :status, foreign_key: { on_delete: :cascade }, null: false
t.belongs_to :group, foreign_key: { on_delete: :cascade }, null: false
end
add_index :group_pinned_statuses, [:status_id, :group_id], unique: true, algorithm: :concurrently
end
end