summaryrefslogtreecommitdiff
path: root/db/post_migrate/20180306164012_add_path_index_to_redirect_routes.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2018-08-14 08:56:28 +0000
committerDouwe Maan <douwe@gitlab.com>2018-08-14 08:56:28 +0000
commit2bb79b8eef40ef28a1fce64b1108bc05e0efafb0 (patch)
tree92aa43625a74c3f4155c6f9ff70e7bb7c5a5e71e /db/post_migrate/20180306164012_add_path_index_to_redirect_routes.rb
parentd94fb81497f770b6ebb2e1b7fe1c5413eba5d481 (diff)
parentf21e655b61725b972ae80d584a66d6deb53a337d (diff)
downloadgitlab-ce-2bb79b8eef40ef28a1fce64b1108bc05e0efafb0.tar.gz
Merge branch '48967-disable-statement-timeout' into 'master'
`disable_statement_timeout` will no longer leak to other migrations Closes #48967 See merge request gitlab-org/gitlab-ce!20503
Diffstat (limited to 'db/post_migrate/20180306164012_add_path_index_to_redirect_routes.rb')
-rw-r--r--db/post_migrate/20180306164012_add_path_index_to_redirect_routes.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/db/post_migrate/20180306164012_add_path_index_to_redirect_routes.rb b/db/post_migrate/20180306164012_add_path_index_to_redirect_routes.rb
index d6fb4f06695..ca9212fae27 100644
--- a/db/post_migrate/20180306164012_add_path_index_to_redirect_routes.rb
+++ b/db/post_migrate/20180306164012_add_path_index_to_redirect_routes.rb
@@ -20,10 +20,10 @@ class AddPathIndexToRedirectRoutes < ActiveRecord::Migration
def up
return unless Gitlab::Database.postgresql?
- disable_statement_timeout
-
- unless index_exists_by_name?(:redirect_routes, INDEX_NAME)
- execute("CREATE UNIQUE INDEX CONCURRENTLY #{INDEX_NAME} ON redirect_routes (lower(path) varchar_pattern_ops);")
+ disable_statement_timeout do
+ unless index_exists_by_name?(:redirect_routes, INDEX_NAME)
+ execute("CREATE UNIQUE INDEX CONCURRENTLY #{INDEX_NAME} ON redirect_routes (lower(path) varchar_pattern_ops);")
+ end
end
end