2018-11-13 07:27:31 +00:00
|
|
|
class CreateProjectAuthorizations < ActiveRecord::Migration[4.2]
|
2016-10-11 12:25:17 +00:00
|
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
|
|
|
|
DOWNTIME = false
|
|
|
|
|
|
|
|
def change
|
|
|
|
create_table :project_authorizations do |t|
|
|
|
|
t.references :user, foreign_key: { on_delete: :cascade }
|
|
|
|
t.references :project, foreign_key: { on_delete: :cascade }
|
|
|
|
t.integer :access_level
|
|
|
|
|
|
|
|
t.index [:user_id, :project_id, :access_level], unique: true, name: 'index_project_authorizations_on_user_id_project_id_access_level'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|