scinote-web/db/migrate/20150713070738_create_user_organizations.rb

14 lines
372 B
Ruby
Raw Normal View History

2017-06-30 16:23:28 +08:00
class CreateUserOrganizations < ActiveRecord::Migration[4.2]
2016-02-12 23:52:43 +08:00
def change
create_table :user_teams do |t|
2016-02-12 23:52:43 +08:00
t.column :role, :integer, null: false, default: 1
t.integer :user_id, null: false
t.integer :team_id, null: false
2016-02-12 23:52:43 +08:00
t.timestamps null: false
end
add_foreign_key :user_teams, :users
add_foreign_key :user_teams, :teams
2016-02-12 23:52:43 +08:00
end
end