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 K83de4af230ad
diff --git a/packages/prisma/schema/commission.prisma b/packages/prisma/schema/commission.prisma
index f094ab29d8..cbfef4457b 100644
--- a/packages/prisma/schema/commission.prisma
+++ b/packages/prisma/schema/commission.prisma
@@ -24,8 +24,8 @@ model Commission {
eventId String? @unique // only for leads and sales
type EventType
- amount Int // only for sales (amount of the sale event)
- quantity Int // only for clicks/leads (quantity of the event)
+ amount Int // only for sales (amount of the sale event)
+ quantity Int // only for clicks/leads (quantity of the event)
earnings Int @default(0) // amount earned by the partner
currency String @default("usd")
status CommissionStatus @default(pending)
diff --git a/packages/prisma/schema/customer.prisma b/packages/prisma/schema/customer.prisma
index d86af4665c..c4bca99ca2 100644
--- a/packages/prisma/schema/customer.prisma
+++ b/packages/prisma/schema/customer.prisma
@@ -16,8 +16,8 @@ model Customer {
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
- project Project @relation(fields: [projectId], references: [id], onDelete: Cascade)
- link Link? @relation(fields: [linkId], references: [id])
+ project Project @relation(fields: [projectId], references: [id], onDelete: Cascade)
+ link Link? @relation(fields: [linkId], references: [id])
commissions Commission[]
@@unique([projectId, externalId])
diff --git a/packages/prisma/schema/domain.prisma b/packages/prisma/schema/domain.prisma
index 8f86c1fe07..0d8e993060 100644
--- a/packages/prisma/schema/domain.prisma
+++ b/packages/prisma/schema/domain.prisma
@@ -1,21 +1,21 @@
model Domain {
- id String @id @default(cuid())
- slug String @unique
- verified Boolean @default(false)
- placeholder String?
- expiredUrl String? @db.LongText // URL to redirect to for expired links
- notFoundUrl String? @db.LongText // URL to redirect to for links that don't exist
- primary Boolean @default(false)
- archived Boolean @default(false)
- lastChecked DateTime @default(now())
- logo String?
+ id String @id @default(cuid())
+ slug String @unique
+ verified Boolean @default(false)
+ placeholder String?
+ expiredUrl String? @db.LongText // URL to redirect to for expired links
+ notFoundUrl String? @db.LongText // URL to redirect to for links that don't exist
+ primary Boolean @default(false)
+ archived Boolean @default(false)
+ lastChecked DateTime @default(now())
+ logo String?
appleAppSiteAssociation Json?
- assetLinks Json?
- links Link[]
- project Project? @relation(fields: [projectId], references: [id], onDelete: Cascade)
- projectId String?
- registeredDomain RegisteredDomain?
- programs Program[]
+ assetLinks Json?
+ links Link[]
+ project Project? @relation(fields: [projectId], references: [id], onDelete: Cascade)
+ projectId String?
+ registeredDomain RegisteredDomain?
+ programs Program[]
// these attributes will exist on both Link and Domain models
createdAt DateTime @default(now())
diff --git a/packages/prisma/schema/link.prisma b/packages/prisma/schema/link.prisma
index da888833e3..c232274e47 100644
--- a/packages/prisma/schema/link.prisma
+++ b/packages/prisma/schema/link.prisma
@@ -75,14 +75,14 @@ model Link {
programEnrollment ProgramEnrollment? @relation(fields: [programId, partnerId], references: [programId, partnerId])
programInvite ProgramInvite?
- program Program? @relation(fields: [programId], references: [id])
- customers Customer[]
+ program Program? @relation(fields: [programId], references: [id])
+ customers Customer[]
commissions Commission[]
- @@index([projectId, archived, folderId, createdAt(sort: Desc)])
- @@index([programId, partnerId])
@@unique([domain, key])
@@unique([projectId, externalId])
+ @@index([projectId, archived, folderId, createdAt(sort: Desc)])
+ @@index([programId, partnerId])
@@index(folderId) // used in /api/folders
@@index(userId) // used in /api/admin/links
}
diff --git a/packages/prisma/schema/misc.prisma b/packages/prisma/schema/misc.prisma
index 1c10b6e12c..3deb323ba5 100644
--- a/packages/prisma/schema/misc.prisma
+++ b/packages/prisma/schema/misc.prisma
@@ -1,16 +1,16 @@
model YearInReview {
- id String @id @default(cuid())
+ id String @id @default(cuid())
year Int
- totalLinks Int
- totalClicks Int
- topLinks Json
+ totalLinks Int
+ totalClicks Int
+ topLinks Json
topCountries Json
workspaceId String
workspace Project @relation(fields: [workspaceId], references: [id])
- createdAt DateTime @default(now())
+ createdAt DateTime @default(now())
sentAt DateTime?
@@index([workspaceId])
diff --git a/packages/prisma/schema/payout.prisma b/packages/prisma/schema/payout.prisma
index 146f916ed4..73f157bbe1 100644
--- a/packages/prisma/schema/payout.prisma
+++ b/packages/prisma/schema/payout.prisma
@@ -30,10 +30,10 @@ model Payout {
updatedAt DateTime @updatedAt
paidAt DateTime?
- program Program @relation(fields: [programId], references: [id])
- partner Partner @relation(fields: [partnerId], references: [id])
- invoice Invoice? @relation(fields: [invoiceId], references: [id])
- commissions Commission[]
+ program Program @relation(fields: [programId], references: [id])
+ partner Partner @relation(fields: [partnerId], references: [id])
+ invoice Invoice? @relation(fields: [invoiceId], references: [id])
+ commissions Commission[]
@@index([programId])
@@index([partnerId])
diff --git a/packages/prisma/schema/schema.prisma b/packages/prisma/schema/schema.prisma
index 14ff990c89..649c82c437 100644
--- a/packages/prisma/schema/schema.prisma
+++ b/packages/prisma/schema/schema.prisma
@@ -22,11 +22,11 @@ model User {
invalidLoginAttempts Int @default(0)
lockedAt DateTime?
- createdAt DateTime @default(now())
- subscribed Boolean @default(true) // email subscription
- source String? // where the user came from
- defaultWorkspace String? // slug of the user's default workspace
- defaultPartnerId String? // the user's default partner ID
+ createdAt DateTime @default(now())
+ subscribed Boolean @default(true) // email subscription
+ source String? // where the user came from
+ defaultWorkspace String? // slug of the user's default workspace
+ defaultPartnerId String? // the user's default partner ID
// relational data
accounts Account[]
sessions Session[]