20181203003808_create_accounts_tags_join_table.rb 230 B

12345678
  1. class CreateAccountsTagsJoinTable < ActiveRecord::Migration[5.2]
  2. def change
  3. create_join_table :accounts, :tags do |t|
  4. t.index [:account_id, :tag_id]
  5. t.index [:tag_id, :account_id], unique: true
  6. end
  7. end
  8. end