diff --git a/backend/resources/migrations/sqlite/20250822000000_foreign_keys_improvements.up.sql b/backend/resources/migrations/sqlite/20250822000000_foreign_keys_improvements.up.sql index 27428113..532130b6 100644 --- a/backend/resources/migrations/sqlite/20250822000000_foreign_keys_improvements.up.sql +++ b/backend/resources/migrations/sqlite/20250822000000_foreign_keys_improvements.up.sql @@ -1,3 +1,4 @@ +PRAGMA foreign_keys=OFF; --------------------------- -- Delete all orphaned rows --------------------------- @@ -170,4 +171,7 @@ SELECT id, created_at, name, credential_id, public_key, attestation_type, transport, user_id, backup_eligible, backup_state FROM webauthn_credentials; DROP TABLE webauthn_credentials; -ALTER TABLE webauthn_credentials_new RENAME TO webauthn_credentials; \ No newline at end of file +ALTER TABLE webauthn_credentials_new RENAME TO webauthn_credentials; + +PRAGMA foreign_keys=ON; +PRAGMA foreign_key_check; \ No newline at end of file