scinote-web/db/migrate/20150715143134_create_results.rb

17 lines
430 B
Ruby
Raw Normal View History

2016-02-12 23:52:43 +08:00
class CreateResults < ActiveRecord::Migration
def change
create_table :results do |t|
t.string :name
t.integer :my_module_id, null: false
t.integer :user_id, null: false
t.timestamps null: false
end
add_foreign_key :results, :users
add_foreign_key :results, :my_modules
add_index :results, :my_module_id
add_index :results, :user_id
add_index :results, :created_at
end
end