about summary refs log tree commit diff
path: root/db/migrate/20191212043419_create_conversation_kicks.rb
blob: 5331148459801de67ebe71b980640034f1a4bdb8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
class CreateConversationKicks < ActiveRecord::Migration[5.2]
  def change
    create_table :conversation_kicks do |t|
      t.references :account, null: false, foreign_key: {on_delete: :cascade}
      t.references :conversation, null: false, foreign_key: {on_delete: :cascade}
    end

    add_index :conversation_kicks, [:account_id, :conversation_id], unique: true
  end
end