Add foreign key on `project_group_links.group_id` & remove invalid data
What does this MR do and why?
For #382397 (closed)
See https://gitlab.com/gitlab-com/dev-sub-department/section-dev-request-for-help/-/issues/26#note_1169262972 for background.
This MR does 2 things:
- Adds foreign key on
project_group_links.group_id
linked togroup.id
- Existing
project_group_links
records, that point to a non existentgroup_id
are deleted via a background migration.
On gitlab.com, as of 3rd Apr, 2023, there is only 1 such record -https://postgres.ai/console/gitlab/gitlab-production-tunnel-pg12/sessions/17444/commands/58383
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
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.
Edited by Manoj M J