Class: Gitlab::BackgroundMigration::SetNullPackageFilesFileStoreToLocalValue

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

Overview

This class is responsible for migrating a range of package files with file_store == NULL to 1.

The index `index_packages_package_files_file_store_is_null` is expected to be used to find the rows here and in the migration scheduling the jobs that run this class.

Defined Under Namespace

Classes: PackageFile

Constant Summary collapse

LOCAL_STORE =

equal to ObjectStorage::Store::LOCAL

1

Instance Method Summary collapse

Instance Method Details

#perform(start_id, stop_id) ⇒ Object


19
20
21
# File 'lib/gitlab/background_migration/set_null_package_files_file_store_to_local_value.rb', line 19

def perform(start_id, stop_id)
  Packages::PackageFile.where(file_store: nil, id: start_id..stop_id).update_all(file_store: LOCAL_STORE)
end