fix(db): add missing indexes, bound unbounded queries, parallelize admin queries
- Add 7 missing indexes: User(kycStatus, isActive, createdAt), Listing(createdAt, featuredUntil, expiresAt), Payment(createdAt) - Add take:50 limit to unbounded findMediaByPropertyId and findByPropertyId - Parallelize sequential queries in getUserDetail with Promise.all Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -57,6 +57,9 @@ model User {
|
||||
|
||||
@@index([phone])
|
||||
@@index([role])
|
||||
@@index([kycStatus])
|
||||
@@index([isActive])
|
||||
@@index([createdAt])
|
||||
}
|
||||
|
||||
enum OAuthProvider {
|
||||
@@ -245,6 +248,9 @@ model Listing {
|
||||
@@index([propertyId])
|
||||
@@index([agentId])
|
||||
@@index([publishedAt])
|
||||
@@index([createdAt])
|
||||
@@index([featuredUntil])
|
||||
@@index([expiresAt])
|
||||
}
|
||||
|
||||
// =============================================================================
|
||||
@@ -378,6 +384,7 @@ model Payment {
|
||||
@@index([transactionId])
|
||||
@@index([status])
|
||||
@@index([providerTxId])
|
||||
@@index([createdAt])
|
||||
}
|
||||
|
||||
// =============================================================================
|
||||
|
||||
Reference in New Issue
Block a user