debian-mirror-gitlab/db/post_migrate/20210730170823_schedule_security_setting_creation.rb

27 lines
592 B
Ruby
Raw Normal View History

2021-10-27 15:23:28 +05:30
# 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