Welcome to mirror list, hosted at ThFree Co, Russian Federation.

20230810124545_schedule_fixing_namespace_ids_of_vulnerability_reads.rb « post_migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0ff461cc1d1455d4c8cfbb6169111f0c24357ca3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# frozen_string_literal: true

class ScheduleFixingNamespaceIdsOfVulnerabilityReads < Gitlab::Database::Migration[2.1]
  MIGRATION = 'FixNamespaceIdsOfVulnerabilityReads'

  disable_ddl_transaction!

  restrict_gitlab_migration gitlab_schema: :gitlab_main

  def up
    queue_batched_background_migration(
      MIGRATION,
      :vulnerability_reads,
      :vulnerability_id,
      job_interval: 2.minutes,
      batch_size: 10_000,
      sub_batch_size: 100
    )
  end

  def down
    delete_batched_background_migration(MIGRATION, :vulnerability_reads, :vulnerability_id, [])
  end
end