summaryrefslogtreecommitdiff
path: root/lib/gitlab/database/async_indexes/postgres_async_index.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/database/async_indexes/postgres_async_index.rb')
-rw-r--r--lib/gitlab/database/async_indexes/postgres_async_index.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/gitlab/database/async_indexes/postgres_async_index.rb b/lib/gitlab/database/async_indexes/postgres_async_index.rb
index dc932482d40..9f5f39613ed 100644
--- a/lib/gitlab/database/async_indexes/postgres_async_index.rb
+++ b/lib/gitlab/database/async_indexes/postgres_async_index.rb
@@ -4,6 +4,8 @@ module Gitlab
module Database
module AsyncIndexes
class PostgresAsyncIndex < SharedModel
+ include QueueErrorHandlingConcern
+
self.table_name = 'postgres_async_indexes'
MAX_IDENTIFIER_LENGTH = Gitlab::Database::MigrationHelpers::MAX_IDENTIFIER_NAME_LENGTH
@@ -15,6 +17,7 @@ module Gitlab
scope :to_create, -> { where("definition ILIKE 'CREATE%'") }
scope :to_drop, -> { where("definition ILIKE 'DROP%'") }
+ scope :ordered, -> { order(attempts: :asc, id: :asc) }
def to_s
definition