Commit f700f3ec authored by Stan Hu's avatar Stan Hu

Disable statement timeout outside of transaction and during adding concurrent index

parent e5c7e118
...@@ -20,6 +20,7 @@ module Gitlab ...@@ -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 ...@@ -140,8 +141,9 @@ module Gitlab
'in the body of your migration class' 'in the body of your migration class'
end end
disable_statement_timeout
transaction do transaction do
disable_statement_timeout
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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment