scinote-web/db/migrate/20150722095027_create_user_my_modules.rb

15 lines
424 B
Ruby
Raw Normal View History

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