Repository Public
1-- Rollback of 003. Run it only together with a checkout of the 0.2.x code (which uses ACCESS_KEY / ACCESS_PASSWORD_HASH,2-- still present in .env.production until the transition is closed). Passkeys, sessions and recovery codes are deleted:3-- take a backup first (scripts/backup.sh).4BEGIN;5DROP TABLE IF EXISTS rate_limits;6DROP TABLE IF EXISTS auth_events;7DROP TABLE IF EXISTS auth_grants;8DROP TABLE IF EXISTS auth_challenges;9DROP INDEX IF EXISTS sessions_active_idx;10DROP INDEX IF EXISTS sessions_public_id_idx;11ALTER TABLE sessions DROP COLUMN IF EXISTS credential_id, DROP COLUMN IF EXISTS public_id, DROP COLUMN IF EXISTS label, DROP COLUMN IF EXISTS auth_at,12 DROP COLUMN IF EXISTS absolute_expires_at, DROP COLUMN IF EXISTS rotated_at, DROP COLUMN IF EXISTS revoked_reason;13DELETE FROM sessions;14DELETE FROM webauthn_credentials;15ALTER TABLE webauthn_credentials DROP COLUMN IF EXISTS device_type, DROP COLUMN IF EXISTS backed_up, DROP COLUMN IF EXISTS aaguid,16 DROP COLUMN IF EXISTS last_used_at, DROP COLUMN IF EXISTS created_via, DROP COLUMN IF EXISTS user_agent;17ALTER TABLE owner DROP COLUMN IF EXISTS user_handle;18DELETE FROM settings WHERE key = 'auth';19DELETE FROM schema_migrations WHERE name = '003_passkeys_sessions.sql';20COMMIT;21