diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-06 21:08:17 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-06 21:08:17 +0300 |
commit | 971f05815d2f22d7bdeab01870cb499299b8c70a (patch) | |
tree | 47e888a9f69ba5861f2fd8d8ff34aac2a1472dbc /spec/db | |
parent | b72b14cb4d1567c555d9e5cb336111afd479ee9e (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/db')
-rw-r--r-- | spec/db/schema_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/db/schema_spec.rb b/spec/db/schema_spec.rb index f3514360a1f..c6f26809385 100644 --- a/spec/db/schema_spec.rb +++ b/spec/db/schema_spec.rb @@ -264,6 +264,18 @@ RSpec.describe 'Database schema' do end end + context 'index names' do + it 'disallows index names with a _ccnew[0-9]* suffix' do + # During REINDEX operations, Postgres generates a temporary index with a _ccnew[0-9]* suffix + # Since indexes are being considered temporary and subject to removal if they stick around for longer. See Gitlab::Database::Reindexing. + # + # Hence we disallow adding permanent indexes with this suffix. + problematic_indexes = Gitlab::Database::PostgresIndex.match("#{Gitlab::Database::Reindexing::ReindexConcurrently::TEMPORARY_INDEX_PATTERN}$").all + + expect(problematic_indexes).to be_empty + end + end + private def retrieve_columns_name_with_jsonb |