@trycompai/db 1.3.11 → 1.3.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/schema.prisma +26 -1
- package/package.json +1 -1
package/dist/schema.prisma
CHANGED
|
@@ -210,12 +210,14 @@ model EvidenceAutomationRun {
|
|
|
210
210
|
// Metadata
|
|
211
211
|
triggeredBy EvidenceAutomationTrigger @default(scheduled)
|
|
212
212
|
runDuration Int? // in milliseconds
|
|
213
|
+
version Int? // Version number that was executed (null = draft)
|
|
213
214
|
Task Task? @relation(fields: [taskId], references: [id])
|
|
214
215
|
taskId String?
|
|
215
216
|
|
|
216
217
|
@@index([evidenceAutomationId])
|
|
217
218
|
@@index([status])
|
|
218
219
|
@@index([createdAt])
|
|
220
|
+
@@index([version])
|
|
219
221
|
}
|
|
220
222
|
|
|
221
223
|
enum EvidenceAutomationRunStatus {
|
|
@@ -233,6 +235,28 @@ enum EvidenceAutomationTrigger {
|
|
|
233
235
|
}
|
|
234
236
|
|
|
235
237
|
|
|
238
|
+
// ===== automation-version.prisma =====
|
|
239
|
+
model EvidenceAutomationVersion {
|
|
240
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('eav'::text)"))
|
|
241
|
+
createdAt DateTime @default(now())
|
|
242
|
+
updatedAt DateTime @updatedAt
|
|
243
|
+
|
|
244
|
+
// Relations
|
|
245
|
+
evidenceAutomationId String
|
|
246
|
+
evidenceAutomation EvidenceAutomation @relation(fields: [evidenceAutomationId], references: [id], onDelete: Cascade)
|
|
247
|
+
|
|
248
|
+
// Version details
|
|
249
|
+
version Int // Sequential version number (1, 2, 3...)
|
|
250
|
+
scriptKey String // S3 key for this version's script
|
|
251
|
+
publishedBy String? // User ID who published
|
|
252
|
+
changelog String? // Optional description of changes
|
|
253
|
+
|
|
254
|
+
@@unique([evidenceAutomationId, version])
|
|
255
|
+
@@index([evidenceAutomationId])
|
|
256
|
+
@@index([createdAt])
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
|
|
236
260
|
// ===== automation.prisma =====
|
|
237
261
|
model EvidenceAutomation {
|
|
238
262
|
id String @id @default(dbgenerated("generate_prefixed_cuid('aut'::text)"))
|
|
@@ -246,7 +270,8 @@ model EvidenceAutomation {
|
|
|
246
270
|
task Task @relation(fields: [taskId], references: [id], onDelete: Cascade)
|
|
247
271
|
|
|
248
272
|
// Relations
|
|
249
|
-
runs
|
|
273
|
+
runs EvidenceAutomationRun[]
|
|
274
|
+
versions EvidenceAutomationVersion[]
|
|
250
275
|
|
|
251
276
|
@@index([taskId])
|
|
252
277
|
}
|