feat(db): add missing FK indexes on Listing, Payment, Subscription
- Add @@index([sellerId]) and @@index([propertyId]) to Listing model - Add @@index([transactionId]) to Payment model - Add @@index([planId]) to Subscription model - Prevents full table scans on frequently-queried foreign keys Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -242,6 +242,8 @@ model Listing {
|
||||
@@index([status])
|
||||
@@index([transactionType])
|
||||
@@index([priceVND])
|
||||
@@index([sellerId])
|
||||
@@index([propertyId])
|
||||
@@index([agentId])
|
||||
@@index([publishedAt])
|
||||
}
|
||||
@@ -372,6 +374,7 @@ model Payment {
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@index([userId])
|
||||
@@index([transactionId])
|
||||
@@index([status])
|
||||
@@index([providerTxId])
|
||||
}
|
||||
@@ -423,6 +426,7 @@ model Subscription {
|
||||
|
||||
usageRecords UsageRecord[]
|
||||
|
||||
@@index([planId])
|
||||
@@index([status])
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user