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

20180212102028_remove_tmp_partial_null_index_from_builds.rb « post_migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
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