The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
add workflow to ProgramEmail
Kiran K848ff8e458b0
diff --git a/packages/prisma/schema/email.prisma b/packages/prisma/schema/email.prismaindex d6e610abda..2efc218cc9 100644--- a/packages/prisma/schema/email.prisma+++ b/packages/prisma/schema/email.prisma@@ -11,20 +11,21 @@ enum ProgramEmailStatus {}model ProgramEmail {- id String @id @default(cuid())- programId String- type ProgramEmailType- status ProgramEmailStatus @default(draft)- name String- subject String- body String @db.Text- deliverAt DateTime?- // deliverWhen Json? @db.Json- createdAt DateTime @default(now())- updatedAt DateTime @updatedAt+ id String @id @default(cuid())+ programId String+ workflowId String? @unique+ type ProgramEmailType+ status ProgramEmailStatus @default(draft)+ name String+ subject String+ body String @db.Text+ deliverAt DateTime?+ createdAt DateTime @default(now())+ updatedAt DateTime @updatedAt- program Program @relation(fields: [programId], references: [id])- groups ProgramEmailGroup[]+ program Program @relation(fields: [programId], references: [id])+ workflow Workflow? @relation(fields: [workflowId], references: [id], onDelete: Cascade)+ groups ProgramEmailGroup[]@@index(programId)}diff --git a/packages/prisma/schema/workflow.prisma b/packages/prisma/schema/workflow.prismaindex c3eb696bbc..24fd40da83 100644--- a/packages/prisma/schema/workflow.prisma+++ b/packages/prisma/schema/workflow.prisma@@ -2,6 +2,7 @@ enum WorkflowTrigger {leadRecordedsaleRecordedcommissionEarned+ partnerJoinedDuration}enum WorkflowTriggerType {@@ -21,8 +22,9 @@ model Workflow {createdAt DateTime @default(now())updatedAt DateTime @updatedAt- program Program @relation(fields: [programId], references: [id], onDelete: Cascade)+ program Program @relation(fields: [programId], references: [id], onDelete: Cascade)bounty Bounty?+ email ProgramEmail?@@index([programId, trigger])}