summaryrefslogtreecommitdiff
path: root/db/migrate/20220109133006_remove_ci_pipelines_lock_version_index.rb
blob: abbd54ff19bfdcccc6829411ab98d755337d6708 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# frozen_string_literal: true

class RemoveCiPipelinesLockVersionIndex < Gitlab::Database::Migration[1.0]
  TABLE = :ci_pipelines
  INDEX_NAME = 'tmp_index_ci_pipelines_lock_version'
  COLUMN = :id

  disable_ddl_transaction!

  def up
    remove_concurrent_index TABLE, COLUMN, where: "lock_version IS NULL", name: INDEX_NAME
  end

  def down
    add_concurrent_index TABLE, COLUMN, where: "lock_version IS NULL", name: INDEX_NAME
  end
end