Files
gitlab-foss/db/post_migrate/20250211230725_reschedule_vulnerabilities_detected_at_backfill.rb
2025-02-12 18:07:32 +00:00

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