Class: Gitlab::BackgroundMigration::BackfillIntegrationsTypeNew
- Inherits:
-
Object
- Object
- Gitlab::BackgroundMigration::BackfillIntegrationsTypeNew
- Includes:
- Database::DynamicModelHelpers
- Defined in:
- lib/gitlab/background_migration/backfill_integrations_type_new.rb
Overview
Backfills the new ‘integrations.type_new` column, which contains the real class name, rather than the legacy class name in `type` which is mapped via `Gitlab::Integrations::StiType`.
Constant Summary
Constants included from Database::DynamicModelHelpers
Database::DynamicModelHelpers::BATCH_SIZE
Instance Method Summary collapse
Methods included from Database::DynamicModelHelpers
#define_batchable_model, #each_batch, #each_batch_range
Instance Method Details
#perform(start_id, stop_id, batch_table, batch_column, sub_batch_size, pause_ms) ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/gitlab/background_migration/backfill_integrations_type_new.rb', line 11 def perform(start_id, stop_id, batch_table, batch_column, sub_batch_size, pause_ms) parent_batch_relation = define_batchable_model(batch_table, connection: connection) .where(batch_column => start_id..stop_id) parent_batch_relation.each_batch(column: batch_column, of: sub_batch_size) do |sub_batch| process_sub_batch(sub_batch) sleep(pause_ms * 0.001) if pause_ms > 0 end end |