feat: API versioning, compound indexes, and new exports
- Add global /api/v1/ prefix with health/ready exclusions - Add compound indexes on Property and Listing for query optimization - Export CsrfMiddleware and UploadedFile type from shared infra - New Prisma migration for compound indexes Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -193,9 +193,14 @@ model Property {
|
||||
valuations Valuation[]
|
||||
media PropertyMedia[]
|
||||
|
||||
// --- Single-column indexes ---
|
||||
@@index([propertyType])
|
||||
@@index([district, city])
|
||||
@@index([location], type: Gist)
|
||||
|
||||
// --- Compound indexes (query optimization) ---
|
||||
@@index([district, propertyType])
|
||||
@@index([district, city, propertyType])
|
||||
}
|
||||
|
||||
model PropertyMedia {
|
||||
@@ -242,6 +247,7 @@ model Listing {
|
||||
transactions Transaction[]
|
||||
inquiries Inquiry[]
|
||||
|
||||
// --- Single-column indexes ---
|
||||
@@index([status])
|
||||
@@index([transactionType])
|
||||
@@index([priceVND])
|
||||
@@ -252,6 +258,13 @@ model Listing {
|
||||
@@index([createdAt])
|
||||
@@index([featuredUntil])
|
||||
@@index([expiresAt])
|
||||
|
||||
// --- Compound indexes (query optimization) ---
|
||||
@@index([sellerId, status, publishedAt(sort: Desc)])
|
||||
@@index([agentId, status])
|
||||
@@index([status, createdAt(sort: Desc)])
|
||||
@@index([status, publishedAt(sort: Desc)])
|
||||
@@index([transactionType, status, createdAt(sort: Desc)])
|
||||
}
|
||||
|
||||
// =============================================================================
|
||||
|
||||
Reference in New Issue
Block a user