summaryrefslogtreecommitdiff
path: root/db/migrate
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-02 09:08:14 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-02 09:08:14 +0000
commitade18c9d68d5a2e6c6e28ef7e9d3add3b3491ace (patch)
treecf4154332fc95283f58cccb1383e43b40485d91d /db/migrate
parentba836d98593d68d8d6c22c540e31c8031a786bd8 (diff)
downloadgitlab-ce-ade18c9d68d5a2e6c6e28ef7e9d3add3b3491ace.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20200330132913_add_index_on_author_id_and_created_at_and_id_to_notes.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/db/migrate/20200330132913_add_index_on_author_id_and_created_at_and_id_to_notes.rb b/db/migrate/20200330132913_add_index_on_author_id_and_created_at_and_id_to_notes.rb
new file mode 100644
index 00000000000..3b0a63ee565
--- /dev/null
+++ b/db/migrate/20200330132913_add_index_on_author_id_and_created_at_and_id_to_notes.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class AddIndexOnAuthorIdAndCreatedAtAndIdToNotes < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :notes, [:author_id, :created_at, :id]
+ remove_concurrent_index :notes, [:author_id, :created_at]
+ end
+
+ def down
+ add_concurrent_index :notes, [:author_id, :created_at]
+ remove_concurrent_index :notes, [:author_id, :created_at, :id]
+ end
+end