about summary refs log tree commit diff
path: root/db/migrate/20181203003808_create_accounts_tags_join_table.rb
blob: 3c275c2b785c2faa4a4eb2f521b81acd332cea17 (plain) (blame)
1
2
3
4
5
6
7
8
class CreateAccountsTagsJoinTable < ActiveRecord::Migration[5.2]
  def change
    create_join_table :accounts, :tags do |t|
      t.index [:account_id, :tag_id]
      t.index [:tag_id, :account_id], unique: true
    end
  end
end