2020-04-08 14:13:33 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class CreateScimIdentities < ActiveRecord::Migration[6.0]
|
|
|
|
DOWNTIME = false
|
|
|
|
|
2020-05-24 23:13:21 +05:30
|
|
|
# rubocop:disable Migration/PreventStrings
|
2020-04-08 14:13:33 +05:30
|
|
|
def change
|
|
|
|
create_table :scim_identities do |t|
|
|
|
|
t.references :group, foreign_key: { to_table: :namespaces, on_delete: :cascade }, null: false
|
|
|
|
t.references :user, index: false, foreign_key: { on_delete: :cascade }, null: false
|
|
|
|
t.timestamps_with_timezone
|
|
|
|
t.boolean :active, default: false
|
|
|
|
t.string :extern_uid, null: false, limit: 255
|
|
|
|
|
|
|
|
t.index 'LOWER(extern_uid),group_id', name: 'index_scim_identities_on_lower_extern_uid_and_group_id', unique: true
|
|
|
|
t.index [:user_id, :group_id], unique: true
|
|
|
|
end
|
|
|
|
end
|
2020-05-24 23:13:21 +05:30
|
|
|
# rubocop:enable Migration/PreventStrings
|
2020-04-08 14:13:33 +05:30
|
|
|
end
|