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/20230718094501_prepare_notes_namespace_id_index.rb')
-rw-r--r--db/post_migrate/20230718094501_prepare_notes_namespace_id_index.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/db/post_migrate/20230718094501_prepare_notes_namespace_id_index.rb b/db/post_migrate/20230718094501_prepare_notes_namespace_id_index.rb
new file mode 100644
index 00000000000..41f57814c41
--- /dev/null
+++ b/db/post_migrate/20230718094501_prepare_notes_namespace_id_index.rb
@@ -0,0 +1,14 @@
+# frozen_string_literal: true
+
+class PrepareNotesNamespaceIdIndex < Gitlab::Database::Migration[2.1]
+ INDEX_NAME = 'index_notes_on_namespace_id'
+
+ # TODO: Index to be created synchronously as part of https://gitlab.com/gitlab-org/gitlab/-/issues/416127
+ def up
+ prepare_async_index :notes, :namespace_id, name: INDEX_NAME
+ end
+
+ def down
+ unprepare_async_index :notes, :namespace_id, name: INDEX_NAME
+ end
+end