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/20220706122719_create_index_on_security_findings_uuid_id_desc.rb')
-rw-r--r--db/post_migrate/20220706122719_create_index_on_security_findings_uuid_id_desc.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/db/post_migrate/20220706122719_create_index_on_security_findings_uuid_id_desc.rb b/db/post_migrate/20220706122719_create_index_on_security_findings_uuid_id_desc.rb
new file mode 100644
index 00000000000..0c2e2cb4b70
--- /dev/null
+++ b/db/post_migrate/20220706122719_create_index_on_security_findings_uuid_id_desc.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+class CreateIndexOnSecurityFindingsUuidIdDesc < Gitlab::Database::Migration[2.0]
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'index_on_security_findings_uuid_and_id_order_desc'
+
+ def up
+ add_concurrent_index(
+ :security_findings,
+ %i[uuid id],
+ order: { id: :desc },
+ name: INDEX_NAME
+ )
+ end
+
+ def down
+ remove_concurrent_index_by_name(
+ :security_findings,
+ INDEX_NAME
+ )
+ end
+end