Class: Gitlab::Database::Migration

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/database/migration.rb

Defined Under Namespace

Modules: LockRetriesConcern Classes: V1_0, V2_0, V2_1

Class Method Summary collapse

Class Method Details

.[](version) ⇒ Object

Raises:

  • (ArgumentError)


59
60
61
62
63
64
65
# File 'lib/gitlab/database/migration.rb', line 59

def self.[](version)
  version = version.to_s
  name = "V#{version.tr('.', '_')}"
  raise ArgumentError, "Unknown migration version: #{version}" unless const_defined?(name, false)

  const_get(name, false)
end

.current_versionObject

The current version to be used in new migrations



68
69
70
# File 'lib/gitlab/database/migration.rb', line 68

def self.current_version
  2.1
end