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

20210730170823_schedule_security_setting_creation.rb « post_migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: cea7b976bf9d6099a733a249521c9eef4e8e70c6 (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
25
26
# frozen_string_literal: true

class ScheduleSecuritySettingCreation < ActiveRecord::Migration[6.1]
  include Gitlab::Database::MigrationHelpers

  MIGRATION = 'CreateSecuritySetting'
  BATCH_SIZE = 1000
  INTERVAL = 5.minutes.to_i

  disable_ddl_transaction!

  def up
    return unless Gitlab.ee? # Security Settings available only in EE version

    queue_background_migration_jobs_by_range_at_intervals(
      define_batchable_model('projects'),
      MIGRATION,
      INTERVAL,
      batch_size: BATCH_SIZE
    )
  end

  # We're adding data so no need for rollback
  def down
  end
end