Commit 839e4d28 authored by Bob Van Landuyt's avatar Bob Van Landuyt

Merge branch 'invalid-location-metadata-issue-347145' into 'master'

Rerun ConvertStringifiedRawMetadataHashToJson migration

See merge request gitlab-org/gitlab!80768
parents 5d641b49 1e4c6529
# frozen_string_literal: true
class RerunConvertStringifiedRawMetadataHashToJson < Gitlab::Database::Migration[1.0]
MIGRATION_CLASS = Gitlab::BackgroundMigration::FixVulnerabilityOccurrencesWithHashesAsRawMetadata
MODEL_CLASS = MIGRATION_CLASS::Finding
DELAY_INTERVAL = 2.minutes
BATCH_SIZE = 500
disable_ddl_transaction!
def up
queue_background_migration_jobs_by_range_at_intervals(
MODEL_CLASS.by_api_report_types,
MIGRATION_CLASS.name.demodulize,
DELAY_INTERVAL,
batch_size: BATCH_SIZE,
track_jobs: true
)
end
def down
# no-op
# up fixes invalid data by updating columns in-place.
# It is a backwards-compatible change, and reversing it in a downgrade would not be desirable.
end
end
aa92afc5f74f051132aeb73889d7360bbd6258b27c0aedb4fea6a44ccce597b3
\ No newline at end of file
......@@ -59,7 +59,7 @@ module Gitlab
private
def mark_job_as_succeeded(*arguments)
Gitlab::Database::BackgroundMigrationJob.mark_all_as_succeeded(
::Gitlab::Database::BackgroundMigrationJob.mark_all_as_succeeded(
'FixVulnerabilityOccurrencesWithHashesAsRawMetadata',
arguments
)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment