Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
6cc88580
Commit
6cc88580
authored
Mar 21, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix-routes-index-migration' into 'master'
Fix routes index migration See merge request !10121
parents
45a2f900
844142e9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
db/migrate/20170317203554_index_routes_path_for_like.rb
db/migrate/20170317203554_index_routes_path_for_like.rb
+2
-2
No files found.
db/migrate/20170317203554_index_routes_path_for_like.rb
View file @
6cc88580
...
@@ -14,7 +14,7 @@ class IndexRoutesPathForLike < ActiveRecord::Migration
...
@@ -14,7 +14,7 @@ class IndexRoutesPathForLike < ActiveRecord::Migration
def
up
def
up
return
unless
Gitlab
::
Database
.
postgresql?
return
unless
Gitlab
::
Database
.
postgresql?
unless
index_exists?
(
:routes
,
name:
INDEX_NAME
)
unless
index_exists?
(
:routes
,
:path
,
name:
INDEX_NAME
)
execute
(
"CREATE INDEX CONCURRENTLY
#{
INDEX_NAME
}
ON routes (path varchar_pattern_ops);"
)
execute
(
"CREATE INDEX CONCURRENTLY
#{
INDEX_NAME
}
ON routes (path varchar_pattern_ops);"
)
end
end
end
end
...
@@ -22,7 +22,7 @@ class IndexRoutesPathForLike < ActiveRecord::Migration
...
@@ -22,7 +22,7 @@ class IndexRoutesPathForLike < ActiveRecord::Migration
def
down
def
down
return
unless
Gitlab
::
Database
.
postgresql?
return
unless
Gitlab
::
Database
.
postgresql?
if
index_exists?
(
:routes
,
name:
INDEX_NAME
)
if
index_exists?
(
:routes
,
:path
,
name:
INDEX_NAME
)
execute
(
"DROP INDEX CONCURRENTLY
#{
INDEX_NAME
}
;"
)
execute
(
"DROP INDEX CONCURRENTLY
#{
INDEX_NAME
}
;"
)
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