20170823162448_create_status_pins.rb 379 B

123456789101112
  1. # frozen_string_literal: true
  2. class CreateStatusPins < ActiveRecord::Migration[5.1]
  3. def change
  4. create_table :status_pins do |t|
  5. t.belongs_to :account, foreign_key: { on_delete: :cascade }, null: false
  6. t.belongs_to :status, foreign_key: { on_delete: :cascade }, null: false
  7. end
  8. add_index :status_pins, [:account_id, :status_id], unique: true
  9. end
  10. end