Files
gitlab-foss/lib/gitlab/background_migration/backfill_ci_runners_partitioned_table.rb
2024-11-05 18:18:22 +00:00

20 lines
680 B
Ruby

# frozen_string_literal: true
module Gitlab
module BackgroundMigration
# Background migration to copy only valid data from ci_runners to its corresponding partitioned table
# rubocop: disable Migration/BatchedMigrationBaseClass -- This is indirectly deriving from the correct base class
class BackfillCiRunnersPartitionedTable < BackfillPartitionedTable
extend ::Gitlab::Utils::Override
private
override :filter_sub_batch_content
def filter_sub_batch_content(relation)
relation.where(runner_type: 1).or(relation.where.not(sharding_key_id: nil))
end
end
# rubocop: enable Migration/BatchedMigrationBaseClass
end
end