-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathschema.prisma
More file actions
42 lines (38 loc) · 1.21 KB
/
Copy pathschema.prisma
File metadata and controls
42 lines (38 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
generator client {
provider = "prisma-client"
output = "./client"
previewFeatures = ["partialIndexes"]
}
datasource db {
provider = "postgresql"
}
model QueueJob {
id BigInt @id @default(autoincrement()) @db.BigInt
queue String
key String?
cron String?
intervalMs BigInt?
repeatFrom String?
payload Json?
result Json?
error Json?
progress Int @default(0)
priority Int @default(0)
attempts Int @default(0)
maxAttempts Int?
runAt DateTime @default(now())
notBefore DateTime?
finishedAt DateTime?
processedAt DateTime?
failedAt DateTime?
deadLetteredAt DateTime?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@unique([queue, key, runAt])
// Partial index for the dequeue hot path: only un-finished rows are indexed, so it stays small and
// carries no dead rows. Requires the `partialIndexes` preview feature (Prisma 7.4+).
@@index([queue, processedAt, priority, runAt], where: raw("\"finishedAt\" IS NULL"))
@@map("queue_jobs")
}