Disable statement timeout outside of transaction and during adding concurrent index
This commit is contained in:
parent
e5c7e11840
commit
f700f3ec5d
|
@ -20,6 +20,7 @@ module Gitlab
|
||||||
|
|
||||||
if Database.postgresql?
|
if Database.postgresql?
|
||||||
options = options.merge({ algorithm: :concurrently })
|
options = options.merge({ algorithm: :concurrently })
|
||||||
|
disable_statement_timeout
|
||||||
end
|
end
|
||||||
|
|
||||||
add_index(table_name, column_name, options)
|
add_index(table_name, column_name, options)
|
||||||
|
@ -140,8 +141,9 @@ module Gitlab
|
||||||
'in the body of your migration class'
|
'in the body of your migration class'
|
||||||
end
|
end
|
||||||
|
|
||||||
transaction do
|
|
||||||
disable_statement_timeout
|
disable_statement_timeout
|
||||||
|
|
||||||
|
transaction do
|
||||||
add_column(table, column, type, default: nil)
|
add_column(table, column, type, default: nil)
|
||||||
|
|
||||||
# Changing the default before the update ensures any newly inserted
|
# Changing the default before the update ensures any newly inserted
|
||||||
|
|
Loading…
Reference in New Issue