summaryrefslogtreecommitdiff
path: root/db/migrate/20220914080716_add_index_to_candidate_id_and_name_on_ml_candidate_params.rb
blob: caf30961ace85e4dad9b587e984ba8086af68c49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

class AddIndexToCandidateIdAndNameOnMlCandidateParams < Gitlab::Database::Migration[2.0]
  disable_ddl_transaction!

  INDEX_NAME = 'index_ml_candidate_params_on_candidate_id_on_name'

  def up
    add_concurrent_index :ml_candidate_params, [:candidate_id, :name], unique: true, name: INDEX_NAME
  end

  def down
    remove_concurrent_index_by_name(:ml_candidate_params, INDEX_NAME)
  end
end