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

14 lines
367 B
Ruby
Raw Normal View History

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