summaryrefslogtreecommitdiff
path: root/db/migrate
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-13 12:09:22 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-13 12:09:22 +0000
commit286fe61013674fe2d245ffc8d2233baf09923e70 (patch)
tree2037291f5863105e54e75be056b49f7d62007cae /db/migrate
parent4cb5e5011abfe8d50ac3a7ebd0018c563c6d7af4 (diff)
downloadgitlab-ce-286fe61013674fe2d245ffc8d2233baf09923e70.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20200310133822_add_index_on_author_id_and_id_and_created_at_to_notes.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/db/migrate/20200310133822_add_index_on_author_id_and_id_and_created_at_to_notes.rb b/db/migrate/20200310133822_add_index_on_author_id_and_id_and_created_at_to_notes.rb
new file mode 100644
index 00000000000..8005da5fbae
--- /dev/null
+++ b/db/migrate/20200310133822_add_index_on_author_id_and_id_and_created_at_to_notes.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class AddIndexOnAuthorIdAndIdAndCreatedAtToNotes < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :notes, [:author_id, :created_at]
+ remove_concurrent_index :notes, [:author_id]
+ end
+
+ def down
+ add_concurrent_index :notes, [:author_id]
+ remove_concurrent_index :notes, [:author_id, :created_at]
+ end
+end