Migrate resource_link_events to ghost users
Issue: https://gitlab.com/gitlab-org/gitlab/-/issues/416588
When a user is destroyed, we should either associate the DB records that reference the user to ghost user or allow the reference column to be nullable.
Because resource_link_events
table's user_id
is not nullable, we should migrate its rows to be associated to ghost user on user deletion.
This MR does:
- Updates the AR model for
resource_link_events
so it is associated tousers
at the application level. - Updates
EE::Users::MigrateRecordsToGhostUserService
so thatresource_link_events
rows are migrated appropriately.
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.