20170926203418_create_board_labels.rb 377 Bytes
Newer Older
1
class CreateBoardLabels < ActiveRecord::Migration[4.2]
2 3 4 5 6 7
  DOWNTIME = false

  disable_ddl_transaction!

  def change
    create_table :board_labels do |t|
8 9
      t.references :board, foreign_key: { on_delete: :cascade }, null: false
      t.references :label, foreign_key: { on_delete: :cascade }, null: false
10 11 12 13
      t.index [:board_id, :label_id], unique: true
    end
  end
end