Commit 989ecb66 authored by Dylan Griffith's avatar Dylan Griffith

Adding more loose foreign keys for ci_pipelines

These [loose foreign
keys](https://docs.gitlab.com/ee/development/database/loose_foreign_keys.html)
are the first step to removing the cross-database foreign keys between
`main` and `ci` databases.

These 3 foreign keys have been determined to be safe for swapping to
loose foreign keys per
https://gitlab.com/gitlab-org/gitlab/-/issues/348269 .

These Loose foreign keys do not require any tests yet until we actually
remove the foreign key as we can't validate the behaviour if the real
foreign key already does the cleanup for us and we already have a test
to show that deletes to `ci_pipelines` are tracked.
parent 90a57559
......@@ -43,6 +43,18 @@ ci_project_mirrors:
- table: namespaces
column: namespace_id
on_delete: async_delete
merge_requests:
- table: ci_pipelines
column: head_pipeline_id
on_delete: async_nullify
vulnerability_statistics:
- table: ci_pipelines
column: latest_pipeline_id
on_delete: async_nullify
vulnerability_occurrence_pipelines:
- table: ci_pipelines
column: pipeline_id
on_delete: async_delete
packages_build_infos:
- table: ci_pipelines
column: pipeline_id
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment