Read about our upcoming Code of Conduct on this issue

20191112221821_add_indexes_for_projects_api_default_params_authenticated.rb 515 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

class AddIndexesForProjectsApiDefaultParamsAuthenticated < ActiveRecord::Migration[5.2]
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  disable_ddl_transaction!

  def up
    add_concurrent_index :projects, %i(created_at id)
    remove_concurrent_index_by_name :projects, 'index_projects_on_created_at'
  end

  def down
    add_concurrent_index :projects, :created_at
    remove_concurrent_index_by_name :projects, 'index_projects_on_created_at_and_id'
  end
end