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

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

class FixProjectsWithoutProjectFeature < ActiveRecord::Migration[5.2]
  include Gitlab::Database::MigrationHelpers

  BATCH_SIZE = 50_000
  MIGRATION = 'FixProjectsWithoutProjectFeature'

  disable_ddl_transaction!

  class Project < ActiveRecord::Base
    include EachBatch
  end

  def up
    queue_background_migration_jobs_by_range_at_intervals(Project, MIGRATION, 2.minutes, batch_size: BATCH_SIZE)
  end

  def down
    # no-op
  end
end