The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Add SubmittedLeadComment model
Rafi27912c91d7d7
diff --git a/apps/web/prisma/schema/comment.prisma b/apps/web/prisma/schema/comment.prismaindex 3eaaa1c8e9..c3960e01b8 100644--- a/apps/web/prisma/schema/comment.prisma+++ b/apps/web/prisma/schema/comment.prisma@@ -16,3 +16,22 @@ model PartnerComment {@@index(createdAt)@@index(userId)}++model SubmittedLeadComment {+ id String @id @default(cuid())+ leadId String+ userId String+ partnerId String? // Populated only if the author is a partner+ text String @db.Text+ partnerVisible Boolean @default(false)+ createdAt DateTime @default(now())+ updatedAt DateTime @updatedAt++ lead SubmittedLead @relation(fields: [leadId], references: [id], onDelete: Cascade)+ user User @relation(fields: [userId], references: [id], onDelete: Cascade)+ partner Partner? @relation(fields: [partnerId], references: [id], onDelete: Cascade)++ @@index([leadId, createdAt])+ @@index(userId)+ @@index(partnerId)+}diff --git a/apps/web/prisma/schema/lead.prisma b/apps/web/prisma/schema/lead.prismaindex cd8f4b7541..68511979c6 100644--- a/apps/web/prisma/schema/lead.prisma+++ b/apps/web/prisma/schema/lead.prisma@@ -21,10 +21,11 @@ model SubmittedLead {createdAt DateTime @default(now())updatedAt DateTime @updatedAt- program Program @relation(fields: [programId], references: [id])- partner Partner @relation(fields: [partnerId], references: [id])- programEnrollment ProgramEnrollment @relation(fields: [programId, partnerId], references: [programId, partnerId])- customer Customer? @relation(fields: [customerId], references: [id])+ program Program @relation(fields: [programId], references: [id])+ partner Partner @relation(fields: [partnerId], references: [id])+ programEnrollment ProgramEnrollment @relation(fields: [programId, partnerId], references: [programId, partnerId])+ customer Customer? @relation(fields: [customerId], references: [id])+ comments SubmittedLeadComment[]@@index([programId, partnerId])@@index(partnerId)diff --git a/apps/web/prisma/schema/partner.prisma b/apps/web/prisma/schema/partner.prismaindex def00c3a56..6c23b56453 100644--- a/apps/web/prisma/schema/partner.prisma+++ b/apps/web/prisma/schema/partner.prisma@@ -97,6 +97,7 @@ model Partner {messages Message[]sentMessages Message[] @relation("SenderPartner")comments PartnerComment[]+ submittedLeadComments SubmittedLeadComment[]discountCodes DiscountCode[]notificationEmails NotificationEmail[]monthlyTraffic MonthlyTraffic?diff --git a/apps/web/prisma/schema/schema.prisma b/apps/web/prisma/schema/schema.prismaindex 3e704a4733..84fc54c31b 100644--- a/apps/web/prisma/schema/schema.prisma+++ b/apps/web/prisma/schema/schema.prisma@@ -51,6 +51,7 @@ model User {programApplications ProgramApplication[]sentMessages Message[]partnerComments PartnerComment[]+ submittedLeadComments SubmittedLeadComment[]fraudEventGroups FraudEventGroup[]fraudAlertsReviewed FraudAlert[] @relation("FraudAlertReviewer")activityLogs ActivityLog[]