mirror of
https://gitlab.com/gitlab-org/gitlab-foss.git
synced 2025-08-10 01:31:45 +00:00
22 lines
593 B
Ruby
22 lines
593 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Gitlab
|
|
module BackgroundMigration
|
|
class BackfillVsCodeSettingsUuid < BatchedMigrationJob
|
|
operation_name :backfill_vs_code_settings_uuid
|
|
scope_to ->(relation) { relation.where(uuid: nil) }
|
|
feature_category :web_ide
|
|
|
|
def perform
|
|
each_sub_batch do |sub_batch|
|
|
vs_code_settings = sub_batch.map do |vs_code_setting|
|
|
vs_code_setting.attributes.merge(uuid: SecureRandom.uuid)
|
|
end
|
|
|
|
VsCode::Settings::VsCodeSetting.upsert_all(vs_code_settings)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|