feat(schema): add deadLetteredAt column and switch to partial dequeue index
Add `deadLetteredAt DateTime?` to QueueJob for first-class dead-letter
tracking (set alongside `failedAt` when a job exhausts its attempts).
Replace the full-table index on `[queue, finishedAt, processedAt, priority,
runAt]` with a partial index filtered on `finishedAt IS NULL`:
@@index([queue, processedAt, priority, runAt], where: raw("\"finishedAt\" IS NULL"))
Finished rows are never scanned by the dequeue hot path, so excluding them
keeps the index small and avoids index bloat from accumulated history.
Requires the `partialIndexes` preview feature (Prisma 7.4+); bump peer
dependencies to `>=7.4` accordingly. O
Olivier Louvignes committed
e722e63ccd282bcf94b5cb5d6b2f3d2aecfc0dbb
Parent: 09e94f7