mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-14 21:24:54 +08:00
18 lines
458 B
Ruby
18 lines
458 B
Ruby
|
class CreateUserProjects < ActiveRecord::Migration
|
||
|
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
|