scinote-web/db/migrate/20150713072417_create_user_projects.rb

18 lines
463 B
Ruby
Raw Normal View History

2017-06-30 16:23:28 +08:00
class CreateUserProjects < ActiveRecord::Migration[4.2]
2016-02-12 23:52:43 +08:00
def change
create_table :user_projects do |t|
t.column :role, :integer, default: 0
# Comment in spite of SQLite
# t.integer :permissions, array: true, default: []
t.integer :user_id, null: false
t.integer :project_id, null: false
t.timestamps null: false
end
add_foreign_key :user_projects, :users
add_foreign_key :user_projects, :projects
end
end