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

backfill_issue_work_item_type_batching_strategy.rb « batching_strategies « background_migration « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 06036eebcb93f1d9fc718dd43b74a497e09f7d3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

module Gitlab
  module BackgroundMigration
    module BatchingStrategies
      # Batching class to use for back-filling issue's work_item_type_id for a single issue type.
      # Batches will be scoped to records where the foreign key is NULL and only of a given issue type
      #
      # If no more batches exist in the table, returns nil.
      class BackfillIssueWorkItemTypeBatchingStrategy < PrimaryKeyBatchingStrategy
        def apply_additional_filters(relation, job_arguments:)
          issue_type = job_arguments.first

          relation.where(issue_type: issue_type)
        end
      end
    end
  end
end