BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
dbf924c5
Commit
dbf924c5
authored
Sep 08, 2017
by
Michael Kozono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify query
Performance does not need to be optimized in this case because this will be run in batches at a controlled rate.
parent
f1e963bd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
15 deletions
+4
-15
delete_conflicting_redirect_routes_range.rb
...und_migration/delete_conflicting_redirect_routes_range.rb
+4
-15
No files found.
lib/gitlab/background_migration/delete_conflicting_redirect_routes_range.rb
View file @
dbf924c5
...
...
@@ -28,25 +28,14 @@ module Gitlab
<<~
ROUTES_MATCH_REDIRECTS
EXISTS (
SELECT 1 FROM routes
WHERE (
#{
route_paths_match_redirects
}
)
WHERE (
LOWER(redirect_routes.path) = LOWER(routes.path)
OR LOWER(redirect_routes.path) LIKE LOWER(CONCAT(routes.path, '/%'))
)
AND routes.id BETWEEN
#{
start_id
}
AND
#{
end_id
}
)
ROUTES_MATCH_REDIRECTS
end
def
route_paths_match_redirects
if
Gitlab
::
Database
.
postgresql?
<<~
ROUTE_PATHS_MATCH_REDIRECTS
LOWER(redirect_routes.path) = LOWER(routes.path)
OR LOWER(redirect_routes.path) LIKE LOWER(CONCAT(routes.path, '/%'))
ROUTE_PATHS_MATCH_REDIRECTS
else
<<~
ROUTE_PATHS_MATCH_REDIRECTS
redirect_routes.path = routes.path
OR redirect_routes.path LIKE CONCAT(routes.path, '/%')
ROUTE_PATHS_MATCH_REDIRECTS
end
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment