summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/database
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2017-05-25 19:43:17 +0000
committerDouwe Maan <douwe@gitlab.com>2017-05-25 19:43:17 +0000
commite20eb71203aa29458d7f51a27d42a3d8208e2494 (patch)
treefad2bcde099bc2559897cbda4d6a8c79b3b825c3 /spec/lib/gitlab/database
parent0a14f9bdf5c6bf69be9d8d8263c84e2bac14e24e (diff)
parenteb21f93267f3d911b40cace81a4f63f857a1243a (diff)
downloadgitlab-ce-e20eb71203aa29458d7f51a27d42a3d8208e2494.tar.gz
Merge branch '32851-fix-postgres-9-1' into 'master'
Resolve "GitLab 9.0 to 9.2 is incompatible with PostgreSQL 9.1" See merge request !11709
Diffstat (limited to 'spec/lib/gitlab/database')
-rw-r--r--spec/lib/gitlab/database/migration_helpers_spec.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/spec/lib/gitlab/database/migration_helpers_spec.rb b/spec/lib/gitlab/database/migration_helpers_spec.rb
index bd5ac6142be..3fdafd867da 100644
--- a/spec/lib/gitlab/database/migration_helpers_spec.rb
+++ b/spec/lib/gitlab/database/migration_helpers_spec.rb
@@ -66,16 +66,23 @@ describe Gitlab::Database::MigrationHelpers, lib: true do
context 'using PostgreSQL' do
before do
- allow(Gitlab::Database).to receive(:postgresql?).and_return(true)
+ allow(model).to receive(:supports_drop_index_concurrently?).and_return(true)
allow(model).to receive(:disable_statement_timeout)
end
- it 'removes the index concurrently' do
+ it 'removes the index concurrently by column name' do
expect(model).to receive(:remove_index).
with(:users, { algorithm: :concurrently, column: :foo })
model.remove_concurrent_index(:users, :foo)
end
+
+ it 'removes the index concurrently by index name' do
+ expect(model).to receive(:remove_index).
+ with(:users, { algorithm: :concurrently, name: "index_x_by_y" })
+
+ model.remove_concurrent_index_by_name(:users, "index_x_by_y")
+ end
end
context 'using MySQL' do