HomePhabricator
Diffusion Comm 11ae2a8c39ac

[keyserver] Run migration to populate special_role column for Admins

Description

[keyserver] Run migration to populate special_role column for Admins

Summary:
Now that we have a specialRoles.ADMIN_ROLE enum, we should populate existing Admins in MariaDB to have this value in their special_role field. Following D9974, we already support populating new Admin's special_role field, so we don't need to worry about that.

There are two decent ways to check for an Admins role, either by role.name === Admins or roleIsAdminRole. The latter is a little more difficult since it requires us to construct RoleInfo to pass it in roleIsAdminRole, and makes it overall difficult to do a simple UPDATE statement. That's why I opted to do it through the first method (checking name)>

Addresses ENG-5837

Depends on D10075

Test Plan: Checked the MariaDB table after the migration and confirmed the Admins roles had the special_role field

Reviewers: atul, ginsu, tomek

Reviewed By: atul

Subscribers: ashoat

Differential Revision: https://phab.comm.dev/D10076

Details

Provenance
rohanAuthored on Nov 24 2023, 10:58 AM
Reviewer
atul
Differential Revision
D10076: [keyserver] Run migration to populate special_role column for Admins
Parents
rCOMMa011993dc8a0: [lib] Introduce a special role for Admins
Branches
Unknown
Tags
Unknown