mirror of
https://gitlab.com/gitlab-org/gitlab-foss.git
synced 2025-08-16 15:57:22 +00:00
30 lines
714 B
Ruby
30 lines
714 B
Ruby
# frozen_string_literal: true
|
|
|
|
class RescheduleVulnerabilitiesDetectedAtBackfill < Gitlab::Database::Migration[2.2]
|
|
milestone '17.9'
|
|
|
|
restrict_gitlab_migration gitlab_schema: :gitlab_sec
|
|
|
|
MIGRATION = "BackfillDetectedAtFromCreatedAtColumn"
|
|
DELAY_INTERVAL = 2.minutes
|
|
BATCH_SIZE = 1000
|
|
SUB_BATCH_SIZE = 100
|
|
|
|
def up
|
|
delete_batched_background_migration(MIGRATION, :vulnerabilities, :id, [])
|
|
|
|
queue_batched_background_migration(
|
|
MIGRATION,
|
|
:vulnerabilities,
|
|
:id,
|
|
job_interval: DELAY_INTERVAL,
|
|
batch_size: BATCH_SIZE,
|
|
sub_batch_size: SUB_BATCH_SIZE
|
|
)
|
|
end
|
|
|
|
def down
|
|
delete_batched_background_migration(MIGRATION, :vulnerabilities, :id, [])
|
|
end
|
|
end
|