scinote-web/db/migrate/20150827130647_create_custom_fields.rb
2016-02-12 16:52:43 +01:00

17 lines
453 B
Ruby

class CreateCustomFields < ActiveRecord::Migration
def change
create_table :custom_fields do |t|
t.string :name, null: false
t.integer :user_id, null: false
t.integer :organization_id, null: false
t.timestamps null: false
end
add_foreign_key :custom_fields, :users
add_foreign_key :custom_fields, :organizations
add_index :custom_fields, :user_id
add_index :custom_fields, :organization_id
end
end