mirror of
https://gitlab.com/gitlab-org/gitlab-foss.git
synced 2025-07-29 12:00:32 +00:00
20 lines
680 B
Ruby
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
|