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

20190905223900_add_concurrent_index_to_builds_metadata.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d394f99567345bc697d6aae7620c9bd1cf36cbe0 (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 AddConcurrentIndexToBuildsMetadata < ActiveRecord::Migration[5.0]
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  disable_ddl_transaction!

  def up
    add_concurrent_index :ci_builds_metadata, [:build_id],
                         where: "interruptible = false",
                         name: "index_ci_builds_metadata_on_build_id_and_interruptible_false"
  end

  def down
    remove_concurrent_index_by_name(:ci_builds_metadata, 'index_ci_builds_metadata_on_build_id_and_interruptible_false')
  end
end