Skip to content

Add asynchronous temporary index for vulnerability findings with potentially mismatched scanners

What does this MR do and why?

Schedules a temporary index for the background migration !89127 (merged) that migrates erroneously associated vulnerability scanners.

CREATE INDEX tmp_index_vulnerability_occurrences_on_id_and_scanner_id ON vulnerability_occurrences USING btree (id, scanner_id) WHERE (report_type = ANY (ARRAY[7, 99]));

Migration output

Up

main: == 20220606082910 AddTmpIndexForPotentiallyMisassociatedVulnerabilityOccurrences: migrating
main: -- index_exists?(:vulnerability_occurrences, [:id, :scanner_id], {:where=>"report_type IN (7,99)", :name=>"tmp_index_vulnerability_occurrences_on_id_and_scanner_id", :algorithm=>:concurrently})
main:    -> 0.0227s
main: == 20220606082910 AddTmpIndexForPotentiallyMisassociatedVulnerabilityOccurrences: migrated (0.0353s)```

### Down

main: == 20220606082910 AddTmpIndexForPotentiallyMisassociatedVulnerabilityOccurrences: reverting main: == 20220606082910 AddTmpIndexForPotentiallyMisassociatedVulnerabilityOccurrences: reverted (0.0180s)```

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #357659 (closed)

Edited by Dominic Bauer

Merge request reports