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

class AddServiceDeskReplyToIsNotNullIndexOnIssuesFix < ActiveRecord::Migration[6.0]
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false
  INDEX_NAME = 'idx_on_issues_where_service_desk_reply_to_is_not_null'

  disable_ddl_transaction!

  def up
    add_concurrent_index(:issues, [:id], name: INDEX_NAME, where: 'service_desk_reply_to IS NOT NULL')
  end

  def down
    remove_concurrent_index_by_name(:issues, INDEX_NAME)
  end
end