Class: Gitlab::BackgroundMigration::SetNullExternalDiffStoreToLocalValue

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

Overview

This class is responsible for migrating a range of merge request diffs with external_diff_store == NULL to 1.

The index `index_merge_request_diffs_external_diff_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: MergeRequestDiff

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_external_diff_store_to_local_value.rb', line 19

def perform(start_id, stop_id)
  MergeRequestDiff.where(external_diff_store: nil, id: start_id..stop_id).update_all(external_diff_store: LOCAL_STORE)
end