Destroy orphaned job artifacts

What does this MR do and why?

We have orphaned job artifacts that should have been destroyed by the FastDestroyAll callbacks. For some reason, they weren't destroyed.

There's a foreign key relation between job artifacts and jobs. The jobs were deleted but the artifacts remained because of a PostgreSQL bug where foreign keys don't work properly for partitioned tables.

Once the foreign key relation is properly fixed, we should remove the code added in this commit as it will no longer be necessary.

See Bug in PostgreSQL causes integrity issues relat... (#508672).

References

How to set up and validate locally

Run the specs.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #499012 (closed)

Edited by Abdul Wadood

Merge request reports

Loading