From c64781252d297ae5c19f81f3d0cadeb8c8c92dc5 Mon Sep 17 00:00:00 2001 From: CREDO23 Date: Mon, 1 Jun 2026 21:02:20 +0200 Subject: [PATCH] feat(zero): define automationRunTable schema --- surfsense_web/zero/schema/automations.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 surfsense_web/zero/schema/automations.ts diff --git a/surfsense_web/zero/schema/automations.ts b/surfsense_web/zero/schema/automations.ts new file mode 100644 index 000000000..4d6ebfac7 --- /dev/null +++ b/surfsense_web/zero/schema/automations.ts @@ -0,0 +1,18 @@ +import { json, number, string, table } from "@rocicorp/zero"; + +// Thin live row: status + per-step progress only. Heavy fields +// (definition_snapshot, inputs, output, artifacts, error) stay on REST +// (`GET /automations/{id}/runs/{run_id}`) and load on detail expand. +// Mirrors the publication shape in migration 148. +export const automationRunTable = table("automation_runs") + .columns({ + id: number(), + automationId: number().from("automation_id"), + triggerId: number().optional().from("trigger_id"), + status: string(), + stepResults: json().from("step_results"), + startedAt: number().optional().from("started_at"), + finishedAt: number().optional().from("finished_at"), + createdAt: number().from("created_at"), + }) + .primaryKey("id");