Skip to content

Backfill `finding_id` foreign key on `vulnerabilities` table

Why are we doing this work?

After Add `finding_id` foreign key to `vulnerabilities` (#418970 - closed) is done, we need to backfill the finding_id foreign key for existing records. To do this, we need to use a batched background migration.

Implementation plan

  • database create a batched background migration to backfill finding_id on vulnerabilities table based on vulnerability_occurrences.vulnerability_id (Vulnerabilities::Finding.table_name == "vulnerability_occurrences")
Edited by Michał Zając