Add FK on events.personal_namespace_id

What does this MR do and why?

Add FK on events.personal_namespace_id for GitLab.com only. Already done for self-managed with !165591 (merged).

Unfortunately, !164979 (merged) was merged and deployed before the FK for GitLab.com was created. To avoid validation failling, we need to cleanup any records that may point to personal namespaces that were deleted. Since we started writing to events.personal_namespace_id just recently, and only when there is no project or group associated, doing this in post-deployment migration does not take too long.

See #462801 (closed).

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Related to #462801 (closed)

Edited by Krasimir Angelov

Merge request reports

Loading