scinote-web/db/migrate/20150827130647_create_custom_fields.rb

18 lines
429 B
Ruby
Raw Normal View History

2016-02-12 23:52:43 +08:00
class CreateCustomFields < ActiveRecord::Migration
def change
create_table :custom_fields do |t|
t.string :name, null: false
t.integer :user_id, null: false
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
add_foreign_key :custom_fields, :users
2017-01-26 23:30:31 +08:00
add_foreign_key :custom_fields, :teams
2016-02-12 23:52:43 +08:00
add_index :custom_fields, :user_id
2017-01-26 23:30:31 +08:00
add_index :custom_fields, :team_id
2016-02-12 23:52:43 +08:00
end
end