scinote-web/db/migrate/20150715132459_create_my_module_comments.rb

11 lines
336 B
Ruby
Raw Normal View History

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