scinote-web/db/migrate/20150820124022_add_default_columns_to_samples.rb

12 lines
361 B
Ruby
Raw Normal View History

2017-06-30 16:23:28 +08:00
class AddDefaultColumnsToSamples < ActiveRecord::Migration[4.2]
2016-02-12 23:52:43 +08:00
def change
add_column :samples, :sample_group_id, :integer
add_column :samples, :sample_type_id, :integer
add_foreign_key :samples, :sample_groups
add_foreign_key :samples, :sample_types
add_index :samples, :sample_group_id
add_index :samples, :sample_type_id
end
end