Commit 6cc88580 authored by Douwe Maan's avatar Douwe Maan

Merge branch 'fix-routes-index-migration' into 'master'

Fix routes index migration

See merge request !10121
parents 45a2f900 844142e9
...@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment