From fd54b4724d90fa37082d5c2e5b339e9a35fc99b7 Mon Sep 17 00:00:00 2001 From: dal Date: Thu, 9 Jan 2025 17:35:54 -0700 Subject: [PATCH] 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. --- .../up.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/migrations/2025-01-08-163102_add_dataset_groups_adjust_teams_adjust_permissions/up.sql b/api/migrations/2025-01-08-163102_add_dataset_groups_adjust_teams_adjust_permissions/up.sql index e1c429ae2..fc62adc5e 100644 --- a/api/migrations/2025-01-08-163102_add_dataset_groups_adjust_teams_adjust_permissions/up.sql +++ b/api/migrations/2025-01-08-163102_add_dataset_groups_adjust_teams_adjust_permissions/up.sql @@ -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