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

11 lines
361 B
Ruby

class AddDefaultColumnsToSamples < ActiveRecord::Migration[4.2]
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