Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'db/post_migrate/20220706115138_create_async_index_on_security_findings.rb')
-rw-r--r--db/post_migrate/20220706115138_create_async_index_on_security_findings.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/db/post_migrate/20220706115138_create_async_index_on_security_findings.rb b/db/post_migrate/20220706115138_create_async_index_on_security_findings.rb
new file mode 100644
index 00000000000..30baa1af91c
--- /dev/null
+++ b/db/post_migrate/20220706115138_create_async_index_on_security_findings.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+class CreateAsyncIndexOnSecurityFindings < Gitlab::Database::Migration[2.0]
+ INDEX_NAME = 'index_on_security_findings_uuid_and_id_order_desc'
+
+ def up
+ prepare_async_index(
+ :security_findings,
+ %i[uuid id],
+ order: { id: :desc },
+ name: INDEX_NAME
+ )
+ end
+
+ def down
+ unprepare_async_index(
+ :security_findings,
+ %i[uuid id],
+ name: INDEX_NAME
+ )
+ end
+end