summaryrefslogtreecommitdiff
path: root/lib/gitlab/database/postgres_index.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/database/postgres_index.rb')
-rw-r--r--lib/gitlab/database/postgres_index.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/gitlab/database/postgres_index.rb b/lib/gitlab/database/postgres_index.rb
index 58e4e7e7924..1079bfdeda3 100644
--- a/lib/gitlab/database/postgres_index.rb
+++ b/lib/gitlab/database/postgres_index.rb
@@ -19,7 +19,12 @@ module Gitlab
end
# Indexes with reindexing support
- scope :reindexing_support, -> { where(partitioned: false, exclusion: false, expression: false, type: Gitlab::Database::Reindexing::SUPPORTED_TYPES) }
+ scope :reindexing_support, -> do
+ where(partitioned: false, exclusion: false, expression: false, type: Gitlab::Database::Reindexing::SUPPORTED_TYPES)
+ .not_match("#{Gitlab::Database::Reindexing::ReindexConcurrently::TEMPORARY_INDEX_PATTERN}$")
+ end
+
+ scope :reindexing_leftovers, -> { match("#{Gitlab::Database::Reindexing::ReindexConcurrently::TEMPORARY_INDEX_PATTERN}$") }
scope :not_match, ->(regex) { where("name !~ ?", regex) }