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.

Add Commission index on partnerId and createdAt

Rafi5a0cec1f2f55
diff --git a/apps/web/prisma/schema/commission.prisma b/apps/web/prisma/schema/commission.prisma
index f852b5130d..88b48383a2 100644
--- a/apps/web/prisma/schema/commission.prisma
+++ b/apps/web/prisma/schema/commission.prisma
@@ -76,6 +76,7 @@ model Commission {
@@index([programId, status, createdAt, amount, earnings]) // for program/commissions (scoped by programId)
@@index([createdAt, status, programId, earnings]) // for admin/commissions
@@index([partnerId, customerId, type, createdAt]) // for finding the firstCommission in create-partner-commission workflow
+ @@index([partnerId, createdAt]) // for partner earnings across all programs (partner-profile/earnings)
@@index(payoutId)
@@index(customerId)
@@index(linkId)