mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-02 19:55:18 +02:00
feat(zero): define automationRunTable schema
This commit is contained in:
parent
ec2b57bfb3
commit
c64781252d
1 changed files with 18 additions and 0 deletions
18
surfsense_web/zero/schema/automations.ts
Normal file
18
surfsense_web/zero/schema/automations.ts
Normal file
|
|
@ -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");
|
||||||
Loading…
Add table
Add a link
Reference in a new issue