feat: add workflow run origin

This commit is contained in:
BennyKok
2023-12-19 12:30:52 +08:00
parent 39dd760ba0
commit 8f67a136c3
6 changed files with 659 additions and 17 deletions
+6
View File
@@ -94,6 +94,11 @@ export const deploymentEnvironment = pgEnum("deployment_environment", [
"production",
]);
export const workflowRunOrigin = pgEnum("workflow_run_origin", [
"manual",
"api",
]);
// We still want to keep the workflow run record.
export const workflowRunsTable = dbSchema.table("workflow_runs", {
id: uuid("id").primaryKey().defaultRandom().notNull(),
@@ -114,6 +119,7 @@ export const workflowRunsTable = dbSchema.table("workflow_runs", {
machine_id: uuid("machine_id").references(() => machinesTable.id, {
onDelete: "set null",
}),
origin: workflowRunOrigin("origin").notNull().default("api"),
status: workflowRunStatus("status").notNull().default("not-started"),
ended_at: timestamp("ended_at"),
created_at: timestamp("created_at").defaultNow().notNull(),