diff --git a/backend/persistence/migrations/20241118114500_change_webauthn_credentials.up.fizz b/backend/persistence/migrations/20241118114500_change_webauthn_credentials.up.fizz index 19906a267..a89db3514 100644 --- a/backend/persistence/migrations/20241118114500_change_webauthn_credentials.up.fizz +++ b/backend/persistence/migrations/20241118114500_change_webauthn_credentials.up.fizz @@ -9,8 +9,8 @@ create_table("webauthn_credential_user_handles") { add_column("webauthn_credentials", "user_handle_id", "uuid", { "null": true }) add_foreign_key("webauthn_credentials", "user_handle_id", {"webauthn_credential_user_handles": ["id"]}, { - "on_delete": "cascade", + "on_delete": "set null", "on_update": "cascade", }) -sql("ALTER TABLE webauthn_credentials ADD CONSTRAINT webauthn_credential_user_handle_fkey FOREIGN KEY (user_handle_id, user_id) REFERENCES webauthn_credential_user_handles(id, user_id) ON DELETE CASCADE ON UPDATE CASCADE;") +sql("ALTER TABLE webauthn_credentials ADD CONSTRAINT webauthn_credential_user_handle_fkey FOREIGN KEY (user_handle_id, user_id) REFERENCES webauthn_credential_user_handles(id, user_id) ON DELETE NO ACTION ON UPDATE CASCADE;")