Migrate database and models for study-group-based authorization
This commit is contained in:

committed by
Sebastian Serth

parent
ec4c6207f0
commit
04ed45ea73
11
db/migrate/20220906142041_add_study_group_authorization.rb
Normal file
11
db/migrate/20220906142041_add_study_group_authorization.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddStudyGroupAuthorization < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
add_column :external_users, :platform_admin, :boolean, default: false, nil: false
|
||||
add_column :internal_users, :platform_admin, :boolean, default: false, nil: false
|
||||
add_column :study_group_memberships, :role, :integer, limit: 1, null: false, default: 0, comment: 'Used as enum in Rails'
|
||||
add_reference :subscriptions, :study_group, index: true, null: true, foreign_key: true
|
||||
add_reference :authentication_tokens, :study_group, index: true, null: true, foreign_key: true
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user