Skip to content

Add migration to backfill project_id to security_scans

What does this MR do and why?

Add migration to backfill project_id to security_scans

security_scans needs to have project_id for all rows so that it can be sharded for cells. There was a period in the past where security_scans.build_id did not have a foreign key, which means that there is a possibility that there are security_scans records that do not have a corresponding ci_builds record. This background migration is used to backfill project_id while accounting for this possibility. If a scan does not have a corresponding build, the scan record will be deleted.

Changelog: changed

related to #454948 (closed)

MR acceptance checklist

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

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Edited by Subashis Chakraborty

Merge request reports

Loading