Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

format Prisma

Kiran K723cb3c367dc
diff --git a/packages/prisma/schema/message.prisma b/packages/prisma/schema/message.prisma
index 6a533d7907..ba19ad506b 100644
--- a/packages/prisma/schema/message.prisma
+++ b/packages/prisma/schema/message.prisma
@@ -1,23 +1,22 @@
-
model Message {
- id String @id @default(cuid())
- programId String
- partnerId String
+ id String @id @default(cuid())
+ programId String
+ partnerId String
senderUserId String
senderPartnerId String? // Populated only if the sender is a partner
- text String @db.Text
+ text String @db.Text
- readInApp DateTime?
- readInEmail DateTime?
- createdAt DateTime @default(now())
- updatedAt DateTime @updatedAt
+ readInApp DateTime?
+ readInEmail DateTime?
+ createdAt DateTime @default(now())
+ updatedAt DateTime @updatedAt
- program Program @relation(fields: [programId], references: [id], onDelete: Cascade)
- partner Partner @relation(fields: [partnerId], references: [id], onDelete: Cascade)
- senderUser User @relation(fields: [senderUserId], references: [id], onDelete: Cascade)
- senderPartner Partner? @relation("SenderPartner", fields: [senderPartnerId], references: [id], onDelete: Cascade)
+ program Program @relation(fields: [programId], references: [id], onDelete: Cascade)
+ partner Partner @relation(fields: [partnerId], references: [id], onDelete: Cascade)
+ senderUser User @relation(fields: [senderUserId], references: [id], onDelete: Cascade)
+ senderPartner Partner? @relation("SenderPartner", fields: [senderPartnerId], references: [id], onDelete: Cascade)
emails NotificationEmail[]
@@index([programId, partnerId])
diff --git a/packages/prisma/schema/notification-email.prisma b/packages/prisma/schema/notification-email.prisma
index 260bbb6cc2..4c49e852dd 100644
--- a/packages/prisma/schema/notification-email.prisma
+++ b/packages/prisma/schema/notification-email.prisma
@@ -3,17 +3,17 @@ enum NotificationEmailType {
}
model NotificationEmail {
- id String @id @default(cuid())
+ id String @id @default(cuid())
emailId String
type NotificationEmailType
openedAt DateTime?
- createdAt DateTime @default(now())
+ createdAt DateTime @default(now())
messageId String?
- message Message? @relation(fields: [messageId], references: [id], onDelete: Cascade)
+ message Message? @relation(fields: [messageId], references: [id], onDelete: Cascade)
@@index(emailId)
@@index(type)
@@index(messageId)
@@index([emailId, openedAt])
-}
\ No newline at end of file
+}