summaryrefslogtreecommitdiff
path: root/db/optional_migrations
diff options
context:
space:
mode:
authorGabriel Mazetto <brodock@gmail.com>2018-07-09 23:31:45 +0200
committerGabriel Mazetto <brodock@gmail.com>2018-08-10 20:40:00 +0200
commit119c49172f6ff37605d72faf2e4868ecdb696a61 (patch)
treef80513221cc660d6dd67d6edaffdbdcf469fe4ee /db/optional_migrations
parent09e7c75d1bf871d0c011ea0f9abfb56fab03b919 (diff)
downloadgitlab-ce-119c49172f6ff37605d72faf2e4868ecdb696a61.tar.gz
Fix specs to use `disable_statement_timeout` correctly
Diffstat (limited to 'db/optional_migrations')
-rw-r--r--db/optional_migrations/composite_primary_keys.rb14
1 files changed, 8 insertions, 6 deletions
diff --git a/db/optional_migrations/composite_primary_keys.rb b/db/optional_migrations/composite_primary_keys.rb
index d45705021b0..7fbc3d4461d 100644
--- a/db/optional_migrations/composite_primary_keys.rb
+++ b/db/optional_migrations/composite_primary_keys.rb
@@ -29,18 +29,20 @@ class CompositePrimaryKeysMigration < ActiveRecord::Migration
def up
return unless Gitlab::Database.postgresql?
- disable_statement_timeout
- TABLES.each do |index|
- add_primary_key(index)
+ disable_statement_timeout(transaction: false) do
+ TABLES.each do |index|
+ add_primary_key(index)
+ end
end
end
def down
return unless Gitlab::Database.postgresql?
- disable_statement_timeout
- TABLES.each do |index|
- remove_primary_key(index)
+ disable_statement_timeout(transaction: false) do
+ TABLES.each do |index|
+ remove_primary_key(index)
+ end
end
end