2
0

feat(results): Add logs in results

This commit is contained in:
Baptiste Arnaud
2022-03-01 11:40:22 +01:00
parent 4630512b8b
commit ebf92b5536
27 changed files with 408 additions and 120 deletions

View File

@ -0,0 +1,14 @@
-- CreateTable
CREATE TABLE "Log" (
"id" TEXT NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"resultId" TEXT NOT NULL,
"status" TEXT NOT NULL,
"description" TEXT NOT NULL,
"details" TEXT,
CONSTRAINT "Log_pkey" PRIMARY KEY ("id")
);
-- AddForeignKey
ALTER TABLE "Log" ADD CONSTRAINT "Log_resultId_fkey" FOREIGN KEY ("resultId") REFERENCES "Result"("id") ON DELETE CASCADE ON UPDATE CASCADE;

View File

@ -129,7 +129,7 @@ model Typebot {
customDomain String? @unique
collaborators CollaboratorsOnTypebots[]
invitations Invitation[]
webhooks Webhook[]
webhooks Webhook[]
@@unique([id, ownerId])
}
@ -184,6 +184,17 @@ model Result {
answers Answer[]
prefilledVariables Json[]
isCompleted Boolean
logs Log[]
}
model Log {
id String @id @default(cuid())
createdAt DateTime @default(now())
resultId String
result Result @relation(fields: [resultId], references: [id], onDelete: Cascade)
status String
description String
details String?
}
model Answer {