Class: Gitlab::Database::BackgroundMigrationJob

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
EachBatch
Defined in:
lib/gitlab/database/background_migration_job.rb

Overview

rubocop:disable Rails/ApplicationRecord

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.mark_all_as_succeeded(class_name, arguments) ⇒ Object


24
25
26
27
# File 'lib/gitlab/database/background_migration_job.rb', line 24

def self.mark_all_as_succeeded(class_name, arguments)
  self.pending.for_migration_execution(class_name, arguments)
    .update_all("status = #{statuses[:succeeded]}, updated_at = NOW()")
end

.normalize_class_name(class_name) ⇒ Object


29
30
31
32
33
# File 'lib/gitlab/database/background_migration_job.rb', line 29

def self.normalize_class_name(class_name)
  return class_name unless class_name.present? && class_name.start_with?('::')

  class_name[2..]
end

Instance Method Details

#class_name=(value) ⇒ Object


35
36
37
# File 'lib/gitlab/database/background_migration_job.rb', line 35

def class_name=(value)
  write_attribute(:class_name, self.class.normalize_class_name(value))
end