scinote-web/db/migrate/20150717085043_create_step_tables.rb
2016-02-12 16:52:43 +01:00

11 lines
341 B
Ruby

class CreateStepTables < ActiveRecord::Migration
def change
create_table :step_tables do |t|
t.integer :step_id, null: false
t.integer :table_id, null: false
end
add_foreign_key :step_tables, :steps
add_foreign_key :step_tables, :tables
add_index :step_tables, [:step_id, :table_id], unique: true
end
end