Add finding_id column to vulnerability backup tables
What does this MR do and why?
Add vulnerability_occurrence_id mapping to 6 backup models to support the transition from vulnerability-centric to finding-centric models as part of the Vulnerabilities Across Contexts feature.
Affected backup tables
| Backup Table | Backup Model | Source Model |
|---|---|---|
backup_vulnerability_state_transitions |
Backups::VulnerabilityStateTransition |
Vulnerabilities::StateTransition |
backup_vulnerability_severity_overrides |
Backups::VulnerabilitySeverityOverride |
Vulnerabilities::SeverityOverride |
backup_vulnerability_issue_links |
Backups::VulnerabilityIssueLink |
Vulnerabilities::IssueLink |
backup_vulnerability_merge_request_links |
Backups::VulnerabilityMergeRequestLink |
Vulnerabilities::MergeRequestLink |
backup_vulnerability_external_issue_links |
Backups::VulnerabilityExternalIssueLink |
Vulnerabilities::ExternalIssueLink |
backup_vulnerability_reads |
Backups::VulnerabilityRead |
Vulnerabilities::Read |
Changes
- Add database migration to add
finding_id bigintcolumn to all 6 backup tables - Update each backup model's
column_mappingto includevulnerability_occurrence_id: :finding_id - Update corresponding specs
This follows the existing pattern used by other finding-related backup tables like backup_finding_flags.
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.
Related to
Closes #589560