scinote-web/db/migrate/20150715142704_create_step_assets.rb
2017-06-30 10:23:28 +02:00

11 lines
332 B
Ruby

class CreateStepAssets < ActiveRecord::Migration[4.2]
def change
create_table :step_assets do |t|
t.integer :step_id, null: false
t.integer :asset_id, null: false
end
add_foreign_key :step_assets, :steps
add_foreign_key :step_assets, :assets
add_index :step_assets, [:step_id, :asset_id]
end
end