summaryrefslogtreecommitdiff
path: root/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base.rb')
-rw-r--r--lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base.rb12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base.rb b/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base.rb
index 60afa4bcd52..565f34b78b7 100644
--- a/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base.rb
+++ b/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base.rb
@@ -51,14 +51,10 @@ module Gitlab
quoted_old_full_path = quote_string(old_full_path)
quoted_old_wildcard_path = quote_string("#{old_full_path}/%")
- filter = if Database.mysql?
- "lower(routes.path) = lower('#{quoted_old_full_path}') "\
- "OR routes.path LIKE '#{quoted_old_wildcard_path}'"
- else
- "routes.id IN "\
- "( SELECT routes.id FROM routes WHERE lower(routes.path) = lower('#{quoted_old_full_path}') "\
- "UNION SELECT routes.id FROM routes WHERE routes.path ILIKE '#{quoted_old_wildcard_path}' )"
- end
+ filter =
+ "routes.id IN "\
+ "( SELECT routes.id FROM routes WHERE lower(routes.path) = lower('#{quoted_old_full_path}') "\
+ "UNION SELECT routes.id FROM routes WHERE routes.path ILIKE '#{quoted_old_wildcard_path}' )"
replace_statement = replace_sql(Route.arel_table[:path],
old_full_path,