feat: add internal flag to job-run table (#563)
* feat: add internal flag to job-run table * add backfill SQL * Update internal backfill to only update internal jobs --------- Co-authored-by: Eric Allam <eallam@icloud.com>
This commit is contained in:
@@ -70,6 +70,7 @@ export class CreateRunService {
|
||||
? eventRecord.externalAccountId
|
||||
: undefined,
|
||||
isTest: eventRecord.isTest,
|
||||
internal: job.internal,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "JobRun" ADD COLUMN "internal" BOOLEAN NOT NULL DEFAULT false;
|
||||
|
||||
/*
|
||||
Backfill JobRun internal flag
|
||||
*/
|
||||
UPDATE "JobRun"
|
||||
SET "internal" = "Job"."internal"
|
||||
FROM "Job"
|
||||
WHERE "JobRun"."jobId" = "Job"."id" AND "JobRun"."internal" = TRUE;
|
||||
@@ -666,6 +666,7 @@ model EventRecord {
|
||||
model JobRun {
|
||||
id String @id @default(cuid())
|
||||
number Int
|
||||
internal Boolean @default(false)
|
||||
|
||||
job Job @relation(fields: [jobId], references: [id], onDelete: Cascade, onUpdate: Cascade)
|
||||
jobId String
|
||||
|
||||
Reference in New Issue
Block a user