diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-02 09:08:14 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-02 09:08:14 +0000 |
commit | ade18c9d68d5a2e6c6e28ef7e9d3add3b3491ace (patch) | |
tree | cf4154332fc95283f58cccb1383e43b40485d91d /db/migrate | |
parent | ba836d98593d68d8d6c22c540e31c8031a786bd8 (diff) | |
download | gitlab-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.rb | 19 |
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 |