Funnel form.

This commit is contained in:
Brian Cao 2023-05-11 16:42:58 -07:00
parent dd2db308ee
commit 1130bca195
19 changed files with 460 additions and 45 deletions

View file

@ -1,18 +1,19 @@
-- CreateTable
CREATE TABLE "report" (
CREATE TABLE "user_report" (
"report_id" UUID NOT NULL,
"user_id" UUID NOT NULL,
"website_id" UUID NOT NULL,
"report_name" VARCHAR(200) NOT NULL,
"template_name" VARCHAR(200) NOT NULL,
"parameters" VARCHAR(6000) NOT NULL,
"created_at" TIMESTAMPTZ(6) DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMPTZ(6),
CONSTRAINT "report_pkey" PRIMARY KEY ("report_id")
CONSTRAINT "user_report_pkey" PRIMARY KEY ("report_id")
);
-- CreateIndex
CREATE UNIQUE INDEX "report_report_id_key" ON "report"("report_id");
CREATE UNIQUE INDEX "user_report_report_id_key" ON "user_report"("report_id");
-- CreateIndex
CREATE INDEX "report_user_id_idx" ON "report"("user_id");
CREATE INDEX "user_report_user_id_idx" ON "user_report"("user_id");

View file

@ -19,7 +19,7 @@ model User {
website Website[]
teamUser TeamUser[]
ReportTemplate ReportTemplate[]
ReportTemplate UserReport[]
@@map("user")
}
@ -156,9 +156,10 @@ model TeamWebsite {
@@map("team_website")
}
model ReportTemplate {
model UserReport {
id String @id() @unique() @map("report_id") @db.Uuid
userId String @map("user_id") @db.Uuid
websiteId String @map("website_id") @db.Uuid
reportName String @map("report_name") @db.VarChar(200)
templateName String @map("template_name") @db.VarChar(200)
parameters String @map("parameters") @db.VarChar(6000)
@ -168,5 +169,5 @@ model ReportTemplate {
user User @relation(fields: [userId], references: [id])
@@index([userId])
@@map("report")
@@map("user_report")
}