2
0

feat(editor): Restore published version button

Had to migrate webhooks into a standalone table
This commit is contained in:
Baptiste Arnaud
2022-03-01 07:13:09 +01:00
parent 0df719d531
commit e17a1a0869
46 changed files with 578 additions and 348 deletions

View File

@ -0,0 +1,15 @@
-- CreateTable
CREATE TABLE "Webhook" (
"id" TEXT NOT NULL,
"url" TEXT,
"method" TEXT NOT NULL,
"queryParams" JSONB[],
"headers" JSONB[],
"body" TEXT,
"typebotId" TEXT NOT NULL,
CONSTRAINT "Webhook_pkey" PRIMARY KEY ("id")
);
-- AddForeignKey
ALTER TABLE "Webhook" ADD CONSTRAINT "Webhook_typebotId_fkey" FOREIGN KEY ("typebotId") REFERENCES "Typebot"("id") ON DELETE CASCADE ON UPDATE CASCADE;

View File

@ -129,6 +129,7 @@ model Typebot {
customDomain String? @unique
collaborators CollaboratorsOnTypebots[]
invitations Invitation[]
webhooks Webhook[]
@@unique([id, ownerId])
}
@ -202,3 +203,14 @@ model Coupon {
code String @id @unique
dateRedeemed DateTime?
}
model Webhook {
id String @id @default(cuid())
url String?
method String
queryParams Json[]
headers Json[]
body String?
typebotId String
typebot Typebot @relation(fields: [typebotId], references: [id], onDelete: Cascade)
}