summaryrefslogtreecommitdiff
path: root/db/migrate/20200310133822_add_index_on_author_id_and_id_and_created_at_to_notes.rb
blob: 8005da5fbaee24b2aa8706531104b0f84d82a001 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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