summaryrefslogtreecommitdiff
path: root/db/post_migrate/20210802112233_add_index_issues_on_project_id_and_state_id_and_created_at_and_id.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/post_migrate/20210802112233_add_index_issues_on_project_id_and_state_id_and_created_at_and_id.rb')
-rw-r--r--db/post_migrate/20210802112233_add_index_issues_on_project_id_and_state_id_and_created_at_and_id.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/db/post_migrate/20210802112233_add_index_issues_on_project_id_and_state_id_and_created_at_and_id.rb b/db/post_migrate/20210802112233_add_index_issues_on_project_id_and_state_id_and_created_at_and_id.rb
new file mode 100644
index 00000000000..318d9e8a218
--- /dev/null
+++ b/db/post_migrate/20210802112233_add_index_issues_on_project_id_and_state_id_and_created_at_and_id.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class AddIndexIssuesOnProjectIdAndStateIdAndCreatedAtAndId < ActiveRecord::Migration[6.1]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+ INDEX_NAME = 'index_issues_on_project_id_and_state_id_and_created_at_and_id'
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :issues, [:project_id, :state_id, :created_at, :id], name: INDEX_NAME
+ end
+
+ def down
+ remove_concurrent_index_by_name :issues, INDEX_NAME
+ end
+end