scinote-web/db/migrate/20150717085043_create_step_tables.rb

12 lines
341 B
Ruby
Raw Normal View History

2016-02-12 23:52:43 +08:00
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