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/20211122033501_improve_index_on_events_for_calendar.rb')
-rw-r--r--db/post_migrate/20211122033501_improve_index_on_events_for_calendar.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/db/post_migrate/20211122033501_improve_index_on_events_for_calendar.rb b/db/post_migrate/20211122033501_improve_index_on_events_for_calendar.rb
new file mode 100644
index 00000000000..517e0f08d6a
--- /dev/null
+++ b/db/post_migrate/20211122033501_improve_index_on_events_for_calendar.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class ImproveIndexOnEventsForCalendar < Gitlab::Database::Migration[1.0]
+ INDEX_NAME = 'index_events_author_id_project_id_action_target_type_created_at'
+
+ def up
+ prepare_async_index :events, [:author_id, :project_id, :action, :target_type, :created_at], name: INDEX_NAME
+ end
+
+ def down
+ unprepare_async_index :events, [:author_id, :project_id, :action, :target_type, :created_at], name: INDEX_NAME
+ end
+end