Module: Gitlab::Database::RenameReservedPathsMigration::V1

Defined in:
lib/gitlab/database/rename_reserved_paths_migration/v1.rb,
lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base.rb,
lib/gitlab/database/rename_reserved_paths_migration/v1/rename_projects.rb,
lib/gitlab/database/rename_reserved_paths_migration/v1/migration_classes.rb,
lib/gitlab/database/rename_reserved_paths_migration/v1/rename_namespaces.rb

Defined Under Namespace

Modules: MigrationClasses Classes: RenameBase, RenameNamespaces, RenameProjects

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(kls) ⇒ Object


15
16
17
# File 'lib/gitlab/database/rename_reserved_paths_migration/v1.rb', line 15

def self.included(kls)
  kls.include(MigrationHelpers)
end

Instance Method Details

#rename_child_paths(one_or_more_paths) ⇒ Object


25
26
27
28
# File 'lib/gitlab/database/rename_reserved_paths_migration/v1.rb', line 25

def rename_child_paths(one_or_more_paths)
  paths = Array(one_or_more_paths)
  RenameNamespaces.new(paths, self).rename_namespaces(type: :child)
end

#rename_root_paths(paths) ⇒ Object


30
31
32
33
# File 'lib/gitlab/database/rename_reserved_paths_migration/v1.rb', line 30

def rename_root_paths(paths)
  paths = Array(paths)
  RenameNamespaces.new(paths, self).rename_namespaces(type: :top_level)
end

#rename_wildcard_paths(one_or_more_paths) ⇒ Object


19
20
21
22
23
# File 'lib/gitlab/database/rename_reserved_paths_migration/v1.rb', line 19

def rename_wildcard_paths(one_or_more_paths)
  rename_child_paths(one_or_more_paths)
  paths = Array(one_or_more_paths)
  RenameProjects.new(paths, self).rename_projects
end

#revert_renamesObject


35
36
37
38
# File 'lib/gitlab/database/rename_reserved_paths_migration/v1.rb', line 35

def revert_renames
  RenameProjects.new([], self).revert_renames
  RenameNamespaces.new([], self).revert_renames
end