2017-06-30 16:23:28 +08:00
|
|
|
class CreateCustomFields < ActiveRecord::Migration[4.2]
|
2016-02-12 23:52:43 +08:00
|
|
|
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
|