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

class DropIndexFromWebauthnRegistrationsOnU2fRegistrationId < Gitlab::Database::Migration[2.1]
  disable_ddl_transaction!

  def up
    with_lock_retries do
      remove_foreign_key_if_exists :webauthn_registrations, column: :u2f_registration_id
    end
  end

  def down
    add_concurrent_foreign_key(
      :webauthn_registrations, :u2f_registrations, column: :u2f_registration_id, on_delete: :cascade)
  end
end