summaryrefslogtreecommitdiff
path: root/db/migrate/20220412140755_drop_unique_fingerprint_md5_index_from_key.rb
blob: 09fb7de07988a705b7f6026146bc49c5e9e80247 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# frozen_string_literal: true

class DropUniqueFingerprintMd5IndexFromKey < Gitlab::Database::Migration[1.0]
  disable_ddl_transaction!

  INDEX_NAME = 'index_keys_on_fingerprint'

  def up
    remove_concurrent_index_by_name :keys, INDEX_NAME
    add_concurrent_index :keys, :fingerprint, name: INDEX_NAME
  end

  def down
    remove_concurrent_index_by_name :keys, INDEX_NAME
    add_concurrent_index :keys, :fingerprint, unique: true, name: INDEX_NAME
  end
end