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

20170121123724_add_index_to_ci_builds_for_status_runner_id_and_type.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c006098fafd07a691767b493a3e55e931a7b0473 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# rubocop:disable RemoveIndex
class AddIndexToCiBuildsForStatusRunnerIdAndType < ActiveRecord::Migration
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  disable_ddl_transaction!

  def up
    add_concurrent_index :ci_builds, [:status, :type, :runner_id]
  end

  def down
    if index_exists?(:ci_builds, [:status, :type, :runner_id])
      remove_index :ci_builds, column: [:status, :type, :runner_id]
    end
  end
end