diff options
author | Sean McGivern <sean@gitlab.com> | 2017-03-21 18:15:40 +0000 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2017-03-21 18:17:29 +0000 |
commit | 844142e9757cb78e454ef3cf2b32accc2c12228a (patch) | |
tree | 1abee3e258ba9e3609ae75ac7e692d0d6c36e6fc /db | |
parent | 45a2f9009bca7a2ba86688f1cf3945dde4381c77 (diff) | |
download | gitlab-ce-844142e9757cb78e454ef3cf2b32accc2c12228a.tar.gz |
Fix routes index migration
For example:
index_exists?(:routes, name: INDEX_NAME) # => false
index_exists?(:routes, :path, name: INDEX_NAME) # => true
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20170317203554_index_routes_path_for_like.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/db/migrate/20170317203554_index_routes_path_for_like.rb b/db/migrate/20170317203554_index_routes_path_for_like.rb index 264ecd322c3..7ac09b2abe5 100644 --- a/db/migrate/20170317203554_index_routes_path_for_like.rb +++ b/db/migrate/20170317203554_index_routes_path_for_like.rb @@ -14,7 +14,7 @@ class IndexRoutesPathForLike < ActiveRecord::Migration def up 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);") end end @@ -22,7 +22,7 @@ class IndexRoutesPathForLike < ActiveRecord::Migration def down 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};") end end |