diff options
author | Douwe Maan <douwe@gitlab.com> | 2018-08-14 11:56:28 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2018-08-14 11:56:28 +0300 |
commit | 2bb79b8eef40ef28a1fce64b1108bc05e0efafb0 (patch) | |
tree | 92aa43625a74c3f4155c6f9ff70e7bb7c5a5e71e /db/post_migrate/20180305100050_remove_permanent_from_redirect_routes.rb | |
parent | d94fb81497f770b6ebb2e1b7fe1c5413eba5d481 (diff) | |
parent | f21e655b61725b972ae80d584a66d6deb53a337d (diff) |
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/20180305100050_remove_permanent_from_redirect_routes.rb')
-rw-r--r-- | db/post_migrate/20180305100050_remove_permanent_from_redirect_routes.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/db/post_migrate/20180305100050_remove_permanent_from_redirect_routes.rb b/db/post_migrate/20180305100050_remove_permanent_from_redirect_routes.rb index db5165dbe70..aa19732ca1c 100644 --- a/db/post_migrate/20180305100050_remove_permanent_from_redirect_routes.rb +++ b/db/post_migrate/20180305100050_remove_permanent_from_redirect_routes.rb @@ -15,10 +15,10 @@ class RemovePermanentFromRedirectRoutes < ActiveRecord::Migration # ReworkRedirectRoutesIndexes: # https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/16211 if Gitlab::Database.postgresql? - disable_statement_timeout - - execute "DROP INDEX CONCURRENTLY IF EXISTS #{INDEX_NAME_PERM};" - execute "DROP INDEX CONCURRENTLY IF EXISTS #{INDEX_NAME_TEMP};" + disable_statement_timeout do + execute "DROP INDEX CONCURRENTLY IF EXISTS #{INDEX_NAME_PERM};" + execute "DROP INDEX CONCURRENTLY IF EXISTS #{INDEX_NAME_TEMP};" + end end remove_column(:redirect_routes, :permanent) @@ -28,10 +28,10 @@ class RemovePermanentFromRedirectRoutes < ActiveRecord::Migration add_column(:redirect_routes, :permanent, :boolean) if Gitlab::Database.postgresql? - disable_statement_timeout - - execute("CREATE INDEX CONCURRENTLY #{INDEX_NAME_PERM} ON redirect_routes (lower(path) varchar_pattern_ops) where (permanent);") - execute("CREATE INDEX CONCURRENTLY #{INDEX_NAME_TEMP} ON redirect_routes (lower(path) varchar_pattern_ops) where (not permanent or permanent is null) ;") + disable_statement_timeout do + execute("CREATE INDEX CONCURRENTLY #{INDEX_NAME_PERM} ON redirect_routes (lower(path) varchar_pattern_ops) where (permanent);") + execute("CREATE INDEX CONCURRENTLY #{INDEX_NAME_TEMP} ON redirect_routes (lower(path) varchar_pattern_ops) where (not permanent or permanent is null) ;") + end end end end |