Skip to content

Swap ci_running_builds FK to projects for LFK

Thong Kuah requested to merge remove_fk_ci_running_builds_to_projects into master

What does this MR do and why?

As part of our CI "decomposition" efforts we need to remove all foreign keys that are cross-database (ie. between the planned main and ci databases). We are going to replace them all with "loose foreign keys".

This foreign key have been determined to be safe for swapping to loose foreign keys per #348267 (closed) :

These records are removed through foreign key constraints from ci_builds: ("fk_rails_da45cfa165" FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE) If we ensure that all builds are deleted before a project is removed, there should not be any problem.

The ci_running_builds table require a non-null build_id column.

related issue: #348267 (closed)

Screenshots or screen recordings

These are strongly recommended to assist reviewers and reduce the time to merge your change.

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 Thong Kuah

Merge request reports