Add migration to fix broken user achievement records
requested to merge gitlab-community/gitlab:425218-deleted-users-that-awarded-achievements-cause-invalid-userachievements-migration into master
What does this MR do and why?
Migrate fields of UserAchievement to Ghost User on User deletion
This fixes currently broken records by migrating them to the Ghost user manually.
Screenshots or screen recordings
No UI changes.
How to set up and validate locally
- Have a user achievement record with a
revoked_at
non nil andrevoked_by_user_id
nil - Migrate the database
- Verify that
revoked_by_user_id
is now equal to the id of the ghost user
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #425218 (closed)
Edited by Niklas van Schrick