Now that we prevent descendant_open_voiced from being a universal community permission for all custom roles in D9493 and fixed up the permissions associated with each user surfaced permission in D9686, we need to fix existing roles. There's two steps here:
- A MariaDB migration to update roles and memberships
- A redux-persist migration that updates the clients thread store
This diff will handle just step 1. Here, we map over all of the permissions that need to be removed (listed in permissionsToRemoveInMigration) and create a dynamic SET clause. I used this guide to write a JSON_REMOVE query that takes multiple paths. The JSON_REMOVE clause looks a little like JSON_REMOVE(permissions, '$.descendant_open_voiced', '$.descendant_manage_pins', '$.descendant_edit_messages', ...)
This will not be landed until the persist migration is up for review + accepted as well so they can land at the same time
Depends on D9686
One part of ENG-5254