Class: Gitlab::BackgroundMigration::BatchingStrategies::BackfillIssueWorkItemTypeBatchingStrategy

Inherits:
PrimaryKeyBatchingStrategy show all
Defined in:
lib/gitlab/background_migration/batching_strategies/backfill_issue_work_item_type_batching_strategy.rb

Overview

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.

Constant Summary

Constants included from Database::DynamicModelHelpers

Database::DynamicModelHelpers::BATCH_SIZE

Instance Method Summary collapse

Methods inherited from PrimaryKeyBatchingStrategy

#next_batch

Methods included from Database::DynamicModelHelpers

#define_batchable_model, #each_batch, #each_batch_range

Methods inherited from BaseStrategy

#initialize, #next_batch

Constructor Details

This class inherits a constructor from Gitlab::BackgroundMigration::BatchingStrategies::BaseStrategy

Instance Method Details

#apply_additional_filters(relation, job_arguments:) ⇒ Object


11
12
13
14
15
# File 'lib/gitlab/background_migration/batching_strategies/backfill_issue_work_item_type_batching_strategy.rb', line 11

def apply_additional_filters(relation, job_arguments:)
  issue_type = job_arguments.first

  relation.where(issue_type: issue_type)
end