scinote-web/db/migrate/20150716061555_create_step_comments.rb

12 lines
348 B
Ruby
Raw Normal View History

2017-06-30 16:23:28 +08:00
class CreateStepComments < ActiveRecord::Migration[4.2]
2016-02-12 23:52:43 +08:00
def change
create_table :step_comments do |t|
t.integer :step_id, null: false
t.integer :comment_id, null: false
end
add_foreign_key :step_comments, :steps
add_foreign_key :step_comments, :comments
add_index :step_comments, [:step_id, :comment_id]
end
end