Skip to content

Add foreign key on `project_group_links.group_id` & remove invalid data

Serena Fang requested to merge project_group_links_cascade_fk into master

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 to group.id
  • Existing project_group_links records, that point to a non existent group_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.

Edited by Manoj M J

Merge request reports

Loading