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

class AddIndexOnCiPipelinesUpdatedAt < ActiveRecord::Migration[5.2]
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false
  INDEX_COLUMNS = [:project_id, :status, :updated_at]

  disable_ddl_transaction!

  def up
    add_concurrent_index(:ci_pipelines, INDEX_COLUMNS)
  end

  def down
    remove_concurrent_index(:ci_pipelines, INDEX_COLUMNS)
  end
end