Create project_authorizations_for_migrations table
What does this MR do and why?
Creates the project_authorizations_for_migrations table and installs a trigger to forward writes from the project_authorizations table.
We need to restore a deleted unique index on project_authorizations over (project_id, user_id) (#418205). To do so, first we need to deduplicate the table since some installations may contain multiple rows per (project_id, user_id) combination with differing access levels. To deduplicate the table, we create the temporary project_authorizations_for_migrations which we will later swap-rename to project_authorizations. The table will be backfilled by !190716.
References
How to set up and validate locally
- Alter project membership and observe the changes are reflected in both
project_authorizationsandproject_authorizations_for_migration - Write a conflicting row to
project_authorizations_for_migrationbefore altering project membership and verify the conflicting row gets overwritten - Delete a user referenced by a row in
project_authorizations_for_migrationand verify the loose foreign key cleans up the row
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #525998 (closed)