Add userName and externalID support
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
16
pkg/coredata/migrations/20260306T120000Z.sql
Normal file
16
pkg/coredata/migrations/20260306T120000Z.sql
Normal file
@@ -0,0 +1,16 @@
|
||||
ALTER TABLE iam_membership_profiles
|
||||
ADD COLUMN user_name TEXT,
|
||||
ADD COLUMN external_id TEXT;
|
||||
|
||||
UPDATE iam_membership_profiles p
|
||||
SET user_name = i.email_address
|
||||
FROM identities i
|
||||
WHERE i.id = p.identity_id AND p.source = 'SCIM';
|
||||
|
||||
CREATE UNIQUE INDEX idx_profiles_user_name_organization_id
|
||||
ON iam_membership_profiles (user_name, organization_id)
|
||||
WHERE user_name IS NOT NULL;
|
||||
|
||||
CREATE UNIQUE INDEX idx_profiles_external_id_organization_id
|
||||
ON iam_membership_profiles (external_id, organization_id)
|
||||
WHERE external_id IS NOT NULL;
|
||||
Reference in New Issue
Block a user