diff options
author | Douwe Maan <douwe@gitlab.com> | 2017-05-25 19:43:17 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2017-05-25 19:43:17 +0000 |
commit | e20eb71203aa29458d7f51a27d42a3d8208e2494 (patch) | |
tree | fad2bcde099bc2559897cbda4d6a8c79b3b825c3 /spec | |
parent | 0a14f9bdf5c6bf69be9d8d8263c84e2bac14e24e (diff) | |
parent | eb21f93267f3d911b40cace81a4f63f857a1243a (diff) | |
download | gitlab-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')
-rw-r--r-- | spec/lib/gitlab/database/migration_helpers_spec.rb | 11 |
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 |