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

20210818185548_add_tag_ids_index_to_ci_pending_build.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b8e00ed9db059833f269c1520ee32e3dfeeb608b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# frozen_string_literal: true

class AddTagIdsIndexToCiPendingBuild < ActiveRecord::Migration[6.1]
  include Gitlab::Database::MigrationHelpers

  disable_ddl_transaction!

  INDEX_NAME = 'index_ci_pending_builds_on_tag_ids'

  def up
    add_concurrent_index(:ci_pending_builds, :tag_ids, name: INDEX_NAME, where: 'cardinality(tag_ids) > 0')
  end

  def down
    remove_concurrent_index_by_name(:ci_pending_builds, name: INDEX_NAME)
  end
end