summaryrefslogtreecommitdiff
path: root/db/migrate/20210409084242_create_index_on_notes_for_cherry_picked_merge_requests.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20210409084242_create_index_on_notes_for_cherry_picked_merge_requests.rb')
-rw-r--r--db/migrate/20210409084242_create_index_on_notes_for_cherry_picked_merge_requests.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/db/migrate/20210409084242_create_index_on_notes_for_cherry_picked_merge_requests.rb b/db/migrate/20210409084242_create_index_on_notes_for_cherry_picked_merge_requests.rb
new file mode 100644
index 00000000000..2bcdf4c8982
--- /dev/null
+++ b/db/migrate/20210409084242_create_index_on_notes_for_cherry_picked_merge_requests.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class CreateIndexOnNotesForCherryPickedMergeRequests < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+ NAME = 'index_notes_for_cherry_picked_merge_requests'
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :notes, [:project_id, :commit_id], where: "((noteable_type)::text = 'MergeRequest'::text)", name: NAME
+ end
+
+ def down
+ remove_concurrent_index_by_name :notes, name: NAME
+ end
+end