diff --git a/src/server/prisma/migrations/20240930174147_add_lighthouse_errormessage/migration.sql b/src/server/prisma/migrations/20240930174147_add_lighthouse_errormessage/migration.sql new file mode 100644 index 0000000..d8ddf22 --- /dev/null +++ b/src/server/prisma/migrations/20240930174147_add_lighthouse_errormessage/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE "WebsiteLighthouseReport" ADD COLUMN "errorMessage" TEXT; diff --git a/src/server/prisma/schema.prisma b/src/server/prisma/schema.prisma index 773d6b7..ea4ddbc 100644 --- a/src/server/prisma/schema.prisma +++ b/src/server/prisma/schema.prisma @@ -264,6 +264,7 @@ model WebsiteLighthouseReport { accessibilityScore Int @default(0) bestPracticesScore Int @default(0) seoScore Int @default(0) + errorMessage String? @@index([createdAt]) @@index([websiteId]) diff --git a/src/server/prisma/zod/websitelighthousereport.ts b/src/server/prisma/zod/websitelighthousereport.ts index 7314323..ce6b25a 100644 --- a/src/server/prisma/zod/websitelighthousereport.ts +++ b/src/server/prisma/zod/websitelighthousereport.ts @@ -14,4 +14,5 @@ export const WebsiteLighthouseReportModelSchema = z.object({ accessibilityScore: z.number().int(), bestPracticesScore: z.number().int(), seoScore: z.number().int(), + errorMessage: z.string().nullish(), }) diff --git a/src/server/trpc/routers/website.ts b/src/server/trpc/routers/website.ts index b6029e2..57caf82 100644 --- a/src/server/trpc/routers/website.ts +++ b/src/server/trpc/routers/website.ts @@ -649,6 +649,7 @@ export const websiteRouter = router({ }, data: { status: WebsiteLighthouseReportStatus.Failed, + errorMessage: String(err), }, }); });