scinote-web/db/migrate/20150716120130_create_sample_my_modules.rb

12 lines
379 B
Ruby
Raw Normal View History

2017-06-30 16:23:28 +08:00
class CreateSampleMyModules < ActiveRecord::Migration[4.2]
2016-02-12 23:52:43 +08:00
def change
create_table :sample_my_modules do |t|
t.integer :sample_id, null: false
t.integer :my_module_id, null: false
end
add_foreign_key :sample_my_modules, :samples
add_foreign_key :sample_my_modules, :my_modules
add_index :sample_my_modules, [:sample_id, :my_module_id]
end
end