scinote-web/db/migrate/20150820120553_create_sample_groups.rb

14 lines
367 B
Ruby
Raw Normal View History

2017-06-30 10:23:28 +02:00
class CreateSampleGroups < ActiveRecord::Migration[4.2]
2016-02-12 16:52:43 +01:00
def change
create_table :sample_groups do |t|
t.string :name, null: false
2017-01-26 16:30:31 +01:00
t.string :color, null: false, default: '#ff0000'
2016-02-12 16:52:43 +01:00
2017-01-26 16:30:31 +01:00
t.integer :team_id, null: false
2016-02-12 16:52:43 +01:00
t.timestamps null: false
end
2017-01-26 16:30:31 +01:00
add_foreign_key :sample_groups, :teams
add_index :sample_groups, :team_id
2016-02-12 16:52:43 +01:00
end
end