mirror of
https://github.com/hex248/sprint.git
synced 2026-02-07 18:23:03 +00:00
full clear
This commit is contained in:
@@ -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");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user