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:
Hemachandar
2023-10-06 20:16:09 +05:30
committed by GitHub
parent 65ad98c20d
commit 1c524c5acc
3 changed files with 12 additions and 0 deletions
@@ -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;
+1
View File
@@ -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