Skip to content

Remove foreign key ci_daily_build_group_report_results.group_id

What does this MR do and why?

The loose foreign key was already added for this in !77721 (merged) . We've confirmed in #348269 (closed) that it is indeed safe to swap these foreign keys for loose foreign keys.

Migrations

Up

== 20220106231518 RemoveForeignKeyCiDailyBuildGroupReportResultsGroupId: migrating
-- transaction_open?()
   -> 0.0000s
-- foreign_keys(:ci_daily_build_group_report_results)
   -> 0.0031s
-- remove_foreign_key(:ci_daily_build_group_report_results, :namespaces, {:name=>"fk_fd1858fefd"})
   -> 0.0039s
== 20220106231518 RemoveForeignKeyCiDailyBuildGroupReportResultsGroupId: migrated (0.0169s)

Down

== 20220106231518 RemoveForeignKeyCiDailyBuildGroupReportResultsGroupId: reverting
-- transaction_open?()
   -> 0.0000s
-- foreign_keys(:ci_daily_build_group_report_results)
   -> 0.0031s
-- transaction_open?()
   -> 0.0000s
-- execute("ALTER TABLE ci_daily_build_group_report_results\nADD CONSTRAINT fk_fd1858fefd\nFOREIGN KEY (group_id)\nREFERENCES namespaces (id)\nON DELETE CASCADE\nNOT VALID;\n")
   -> 0.0028s
-- execute("ALTER TABLE ci_daily_build_group_report_results VALIDATE CONSTRAINT fk_fd1858fefd;")
   -> 0.0027s
== 20220106231518 RemoveForeignKeyCiDailyBuildGroupReportResultsGroupId: reverted (0.0162s)

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.

Related to #348269 (closed)

Edited by Dylan Griffith

Merge request reports