From cb84068f122b36adf63b07f9cbc50de3384cf7c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Berg=C3=A9?= Date: Sun, 5 Jan 2025 13:54:29 +0100 Subject: [PATCH] fix(project): fix project deletion with build reviews --- apps/backend/src/graphql/services/project.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/backend/src/graphql/services/project.ts b/apps/backend/src/graphql/services/project.ts index cb295fd89..6321122f5 100644 --- a/apps/backend/src/graphql/services/project.ts +++ b/apps/backend/src/graphql/services/project.ts @@ -4,6 +4,7 @@ import { TransactionOrKnex } from "objection"; import { Build, BuildNotification, + BuildReview, Capture, Crawl, Project, @@ -76,6 +77,10 @@ export async function unsafe_deleteProject(args: { .joinRelated("build") .where("build.projectId", args.projectId) .delete(); + await BuildReview.query(trx) + .joinRelated("build") + .where("build.projectId", args.projectId) + .delete(); await Build.query(trx).where("projectId", args.projectId).delete(); await ScreenshotBucket.query(trx) .where("projectId", args.projectId)