scinote-web/db/migrate/20150717085133_create_result_tables.rb

12 lines
348 B
Ruby
Raw Normal View History

2017-06-30 16:23:28 +08:00
class CreateResultTables < ActiveRecord::Migration[4.2]
2016-02-12 23:52:43 +08:00
def change
create_table :result_tables do |t|
t.integer :result_id, null: false
t.integer :table_id, null: false
end
add_foreign_key :result_tables, :results
add_foreign_key :result_tables, :tables
add_index :result_tables, [:result_id, :table_id]
end
end