Class: Gitlab::BackgroundMigration::MoveContainerRegistryEnabledToProjectFeature

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/background_migration/move_container_registry_enabled_to_project_feature.rb

Overview

This migration moves projects.container_registry_enabled values to project_features.container_registry_access_level for the projects within the given range of ids.

Constant Summary collapse

MAX_BATCH_SIZE =
300
ENABLED =
20
DISABLED =
0

Instance Method Summary collapse

Instance Method Details

#perform(from_id, to_id) ⇒ Object


14
15
16
17
18
19
20
# File 'lib/gitlab/background_migration/move_container_registry_enabled_to_project_feature.rb', line 14

def perform(from_id, to_id)
  (from_id..to_id).each_slice(MAX_BATCH_SIZE) do |batch|
    process_batch(batch.first, batch.last)
  end

  Gitlab::Database::BackgroundMigrationJob.mark_all_as_succeeded('MoveContainerRegistryEnabledToProjectFeature', [from_id, to_id])
end