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/20230414150202_add_issues_incident_type_temp_index.rb')
-rw-r--r--db/post_migrate/20230414150202_add_issues_incident_type_temp_index.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/db/post_migrate/20230414150202_add_issues_incident_type_temp_index.rb b/db/post_migrate/20230414150202_add_issues_incident_type_temp_index.rb
new file mode 100644
index 00000000000..7c89e454c0c
--- /dev/null
+++ b/db/post_migrate/20230414150202_add_issues_incident_type_temp_index.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class AddIssuesIncidentTypeTempIndex < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'tmp_index_issues_on_issue_type_and_id_only_incidents'
+ INCIDENT_ENUM_VALUE = 1
+
+ def up
+ add_concurrent_index :issues, [:issue_type, :id], name: INDEX_NAME, where: "issue_type = #{INCIDENT_ENUM_VALUE}"
+ end
+
+ def down
+ remove_concurrent_index_by_name :issues, INDEX_NAME
+ end
+end