Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2016-06-15 18:04:07 +0300
committerYorick Peterse <yorickpeterse@gmail.com>2016-06-15 18:04:07 +0300
commit816c453558c6d25fd8724bd3fe08e6fd221f2887 (patch)
treef4ff1664f6bf0e8cc64c92f05f973b8b1927b580 /spec/lib/gitlab/database/migration_helpers_spec.rb
parent8966263e0c738e85d8872aee0bfcf7fbe77b22a6 (diff)
Don't update columns in batches in a transaction
This ensures that whatever locks are acquired aren't held onto until the end of the transaction (= after _all_ rows have been updated). Timing wise there's also no difference between using a transaction and not using one.
Diffstat (limited to 'spec/lib/gitlab/database/migration_helpers_spec.rb')
-rw-r--r--spec/lib/gitlab/database/migration_helpers_spec.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/lib/gitlab/database/migration_helpers_spec.rb b/spec/lib/gitlab/database/migration_helpers_spec.rb
index b46f56196eb..9096ad101b0 100644
--- a/spec/lib/gitlab/database/migration_helpers_spec.rb
+++ b/spec/lib/gitlab/database/migration_helpers_spec.rb
@@ -90,7 +90,7 @@ describe Gitlab::Database::MigrationHelpers, lib: true do
before do
expect(model).to receive(:transaction_open?).and_return(false)
- expect(model).to receive(:transaction).twice.and_yield
+ expect(model).to receive(:transaction).and_yield
expect(model).to receive(:add_column).
with(:projects, :foo, :integer, default: nil)