2
0

feat: Add custom domains

This commit is contained in:
Baptiste Arnaud
2022-02-18 14:57:10 +01:00
parent 1c178e01a6
commit f3ecb948a1
18 changed files with 694 additions and 66 deletions

View File

@ -0,0 +1,30 @@
/*
Warnings:
- A unique constraint covering the columns `[customDomain]` on the table `PublicTypebot` will be added. If there are existing duplicate values, this will fail.
- A unique constraint covering the columns `[customDomain]` on the table `Typebot` will be added. If there are existing duplicate values, this will fail.
*/
-- AlterTable
ALTER TABLE "PublicTypebot" ADD COLUMN "customDomain" TEXT;
-- AlterTable
ALTER TABLE "Typebot" ADD COLUMN "customDomain" TEXT;
-- CreateTable
CREATE TABLE "CustomDomain" (
"ownerId" TEXT NOT NULL,
"name" TEXT NOT NULL
);
-- CreateIndex
CREATE UNIQUE INDEX "CustomDomain_name_key" ON "CustomDomain"("name");
-- CreateIndex
CREATE UNIQUE INDEX "PublicTypebot_customDomain_key" ON "PublicTypebot"("customDomain");
-- CreateIndex
CREATE UNIQUE INDEX "Typebot_customDomain_key" ON "Typebot"("customDomain");
-- AddForeignKey
ALTER TABLE "CustomDomain" ADD CONSTRAINT "CustomDomain_ownerId_fkey" FOREIGN KEY ("ownerId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;

View File

@ -50,6 +50,13 @@ model User {
plan Plan @default(FREE)
stripeId String? @unique
credentials Credentials[]
customDomains CustomDomain[]
}
model CustomDomain {
ownerId String
owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade)
name String @unique
}
model Credentials {
@ -109,19 +116,21 @@ model Typebot {
theme Json
settings Json
publicId String? @unique
customDomain String? @unique
}
model PublicTypebot {
id String @id @default(cuid())
typebotId String @unique
typebot Typebot @relation(fields: [typebotId], references: [id], onDelete: Cascade)
name String
blocks Json[]
variables Json[]
edges Json[]
theme Json
settings Json
publicId String? @unique
id String @id @default(cuid())
typebotId String @unique
typebot Typebot @relation(fields: [typebotId], references: [id], onDelete: Cascade)
name String
blocks Json[]
variables Json[]
edges Json[]
theme Json
settings Json
publicId String? @unique
customDomain String? @unique
}
model Result {