2021-11-23 04:10:20 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Gitlab
|
|
|
|
module BackgroundMigration
|
|
|
|
# Remove vulnerability finding link records
|
|
|
|
# The records will be repopulated from the `raw_metadata`
|
|
|
|
# column of `vulnerability_occurrences` once the unique
|
|
|
|
# index is in place.
|
|
|
|
class RemoveVulnerabilityFindingLinks
|
|
|
|
include Gitlab::Database::DynamicModelHelpers
|
|
|
|
|
|
|
|
def perform(start_id, stop_id)
|
2022-05-05 05:08:00 -04:00
|
|
|
define_batchable_model('vulnerability_finding_links', connection: ApplicationRecord.connection)
|
2022-01-31 13:18:10 -05:00
|
|
|
.where(id: start_id..stop_id)
|
|
|
|
.delete_all
|
2021-11-23 04:10:20 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|