Skip to content

Migrate resource_link_events to ghost users

euko requested to merge 416588-migrate-resource-link-event-to-ghost-users into master

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:

  1. Updates the AR model for resource_link_events so it is associated to users at the application level.
  2. Updates EE::Users::MigrateRecordsToGhostUserService so that resource_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.

Merge request reports