Update team role handling in migration script to include 'admin' as 'manager' and default to 'member'

- Modified the role adjustment logic in the teams_to_users table to treat 'admin' roles as 'manager'.
- Set the default role to 'member' for all other cases, improving clarity in role assignments.

These changes enhance the migration process for dataset groups and permissions management.
This commit is contained in:
dal 2025-01-09 17:35:54 -07:00
parent 1182235116
commit fd54b4724d
No known key found for this signature in database
GPG Key ID: 16F4B0E1E9F61122
1 changed files with 2 additions and 1 deletions

View File

@ -106,7 +106,8 @@ CREATE TYPE team_role_enum AS ENUM ('manager', 'member');
ALTER TABLE teams_to_users ALTER COLUMN role TYPE team_role_enum USING
CASE
WHEN role::text = 'owner' THEN 'manager'::team_role_enum
ELSE role::text::team_role_enum
WHEN role::text = 'admin' THEN 'manager'::team_role_enum
ELSE 'member'::team_role_enum
END;
-- Set new default