debian-mirror-gitlab/db/post_migrate/20190703185326_fix_wrong_pages_access_level.rb
2019-09-30 21:07:59 +05:30

29 lines
599 B
Ruby

# frozen_string_literal: true
class FixWrongPagesAccessLevel < ActiveRecord::Migration[5.1]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
MIGRATION = 'FixPagesAccessLevel'
BATCH_SIZE = 20_000
BATCH_TIME = 2.minutes
disable_ddl_transaction!
class ProjectFeature < ActiveRecord::Base
include ::EachBatch
self.table_name = 'project_features'
self.inheritance_column = :_type_disabled
end
def up
queue_background_migration_jobs_by_range_at_intervals(
ProjectFeature,
MIGRATION,
BATCH_TIME,
batch_size: BATCH_SIZE)
end
end