diff options
Diffstat (limited to 'lib/gitlab/database/rename_reserved_paths_migration/v1/rename_namespaces.rb')
-rw-r--r-- | lib/gitlab/database/rename_reserved_paths_migration/v1/rename_namespaces.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_namespaces.rb b/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_namespaces.rb index 434167b0f88..f85f2d90f02 100644 --- a/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_namespaces.rb +++ b/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_namespaces.rb @@ -43,15 +43,15 @@ module Gitlab reverts_for_type('namespace') do |path_before_rename, current_path| matches_path = MigrationClasses::Route.arel_table[:path].matches(current_path) namespace = MigrationClasses::Namespace.joins(:route) - .where(matches_path).first.becomes(MigrationClasses::Namespace) + .where(matches_path).first&.becomes(MigrationClasses::Namespace) if namespace perform_rename(namespace, current_path, path_before_rename) rename_namespace_dependencies(namespace, current_path, path_before_rename) else - say "Couldn't rename namespace##{namespace.id} from #{current_path} "\ - " back to #{path_before_rename}, namespace no longer exists" + say "Couldn't rename namespace from #{current_path} back to #{path_before_rename} "\ + "namespace was renamed, or no longer exists at the expected path" end end end |