summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2016-07-14 18:50:46 -0700
committerStan Hu <stanhu@gmail.com>2016-07-14 18:50:46 -0700
commitf700f3ec5d524afd1575a27da76b39b08947b7ea (patch)
tree2eab2b6c8b46d3032ceaba963f9c64b2b3fa0098
parente5c7e11840871e3138ad32693d86de8d7cd7c670 (diff)
downloadgitlab-ce-f700f3ec5d524afd1575a27da76b39b08947b7ea.tar.gz
Disable statement timeout outside of transaction and during adding concurrent index
-rw-r--r--lib/gitlab/database/migration_helpers.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/gitlab/database/migration_helpers.rb b/lib/gitlab/database/migration_helpers.rb
index 593ee5d9568..927f9dad20b 100644
--- a/lib/gitlab/database/migration_helpers.rb
+++ b/lib/gitlab/database/migration_helpers.rb
@@ -20,6 +20,7 @@ module Gitlab
if Database.postgresql?
options = options.merge({ algorithm: :concurrently })
+ disable_statement_timeout
end
add_index(table_name, column_name, options)
@@ -140,8 +141,9 @@ module Gitlab
'in the body of your migration class'
end
+ disable_statement_timeout
+
transaction do
- disable_statement_timeout
add_column(table, column, type, default: nil)
# Changing the default before the update ensures any newly inserted