Disable statement timeout outside of transaction and during adding concurrent index

This commit is contained in:
Stan Hu 2016-07-14 18:50:46 -07:00
parent e5c7e11840
commit f700f3ec5d
1 changed files with 3 additions and 1 deletions

View File

@ -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