summaryrefslogtreecommitdiff
path: root/db/post_migrate/20180212102028_remove_tmp_partial_null_index_from_builds.rb
blob: ed7b1fc72f46fac46ec83b1b041f16e53f7b2121 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
class RemoveTmpPartialNullIndexFromBuilds < ActiveRecord::Migration
  include Gitlab::Database::MigrationHelpers

  disable_ddl_transaction!

  def up
    remove_concurrent_index_by_name(:ci_builds, 'tmp_id_partial_null_index')
  end

  def down
    add_concurrent_index(:ci_builds, :id, where: 'stage_id IS NULL',
                                          name: 'tmp_id_partial_null_index')
  end
end