summaryrefslogtreecommitdiff
path: root/db/post_migrate/20180212102028_remove_tmp_partial_null_index_from_builds.rb
blob: 2444df881b8443a51ee4552fffc79776fd8adee5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
class RemoveTmpPartialNullIndexFromBuilds < ActiveRecord::Migration[4.2]
  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