full clear

This commit is contained in:
Oliver Bryan
2026-01-21 19:35:45 +00:00
parent a1897800d8
commit aac471f1e1

View File

@@ -20,14 +20,9 @@ async function resetDatabase() {
console.log("resetting database..."); console.log("resetting database...");
try { try {
// drop all tables in the correct order (respecting foreign key constraints) // drop and recreate the public schema to clear everything
await db.execute(sql`DROP TABLE IF EXISTS "TimedSession" CASCADE`); await db.execute(sql`DROP SCHEMA IF EXISTS public CASCADE`);
await db.execute(sql`DROP TABLE IF EXISTS "Session" CASCADE`); await db.execute(sql`CREATE SCHEMA public`);
await db.execute(sql`DROP TABLE IF EXISTS "Issue" CASCADE`);
await db.execute(sql`DROP TABLE IF EXISTS "Project" CASCADE`);
await db.execute(sql`DROP TABLE IF EXISTS "OrganisationMember" CASCADE`);
await db.execute(sql`DROP TABLE IF EXISTS "Organisation" CASCADE`);
await db.execute(sql`DROP TABLE IF EXISTS "User" CASCADE`);
console.log("all tables dropped"); console.log("all tables dropped");