debian-mirror-gitlab/db/migrate/20200510183128_add_foreign_key_from_webauthn_registrations_to_users.rb

22 lines
473 B
Ruby
Raw Normal View History

2020-07-28 23:09:34 +05:30
# frozen_string_literal: true
class AddForeignKeyFromWebauthnRegistrationsToUsers < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
# disable_ddl_transaction!
def up
with_lock_retries do
2021-01-03 14:25:43 +05:30
add_foreign_key :webauthn_registrations, :users, column: :user_id, on_delete: :cascade
2020-07-28 23:09:34 +05:30
end
end
def down
with_lock_retries do
remove_foreign_key :webauthn_registrations, column: :user_id
end
end
end