Page MenuHomePhabricator

[keyserver] Run migration to populate special_role column for Admins
ClosedPublic

Authored by rohan on Nov 28 2023, 11:32 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Feb 27, 7:24 PM
Unknown Object (File)
Thu, Feb 27, 7:15 PM
Unknown Object (File)
Thu, Feb 27, 7:15 PM
Unknown Object (File)
Wed, Feb 26, 6:43 AM
Unknown Object (File)
Sun, Feb 23, 10:18 PM
Unknown Object (File)
Tue, Feb 18, 6:38 AM
Unknown Object (File)
Jan 26 2025, 3:37 AM
Unknown Object (File)
Jan 20 2025, 12:21 PM
Subscribers

Details

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

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable