Welcome to mirror list, hosted at ThFree Co, Russian Federation.

20180503175054_add_indexes_to_project_mirror_data.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 15a188594b0fd2cd4f0f27f51b2b0292e63ed080 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
class AddIndexesToProjectMirrorData < ActiveRecord::Migration[4.2]
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  disable_ddl_transaction!

  def up
    add_concurrent_index :project_mirror_data, :jid
    add_concurrent_index :project_mirror_data, :status
  end

  def down
    # rubocop:disable Migration/RemoveIndex
    remove_index :project_mirror_data, :jid if index_exists? :project_mirror_data, :jid
    remove_index :project_mirror_data, :status if index_exists? :project_mirror_data, :status
  end
end