···99 "key": "tid",1010 "record": {1111 "type": "object",1212- "required": ["pipeline", "status", "startedAt", "updatedAt"],1212+ "required": ["pipeline", "workflow", "status", "createdAt"],1313 "properties": {1414 "pipeline": {1515 "type": "string",1616 "format": "at-uri",1717- "description": "pipeline at ref"1717+ "description": "ATURI of the pipeline"1818+ },1919+ "workflow": {2020+ "type": "string",2121+ "format": "at-uri",2222+ "description": "name of the workflow within this pipeline"1823 },1924 "status": {2025 "type": "string",2121- "description": "Pipeline status",2626+ "description": "status of the workflow",2227 "enum": [2328 "pending",2429 "running",···3328 "success"3429 ]3530 },3131+ "createdAt": {3232+ "type": "string",3333+ "format": "datetime",3434+ "description": "time of creation of this status update"3535+ },3636 "error": {3737 "type": "string",3838 "description": "error message if failed"···4535 "exitCode": {4636 "type": "integer",4737 "description": "exit code if failed"4848- },4949- "startedAt": {5050- "type": "string",5151- "format": "datetime",5252- "description": "pipeline start time"5353- },5454- "updatedAt": {5555- "type": "string",5656- "format": "datetime",5757- "description": "pipeline last updated time"5858- },5959- "finishedAt": {6060- "type": "string",6161- "format": "datetime",6262- "description": "pipeline finish time, if finished"6338 }6439 }6540 }
+5-13
spindle/db/db.go
···3030 did text primary key3131 );32323333- create table if not exists pipeline_status (3333+ -- status event for a single workflow3434+ create table if not exists events (3435 rkey text not null,3535- pipeline text not null,3636- status text not null,3737-3838- -- only set if status is 'failed'3939- error text,4040- exit_code integer,4141-4242- started_at timestamp not null default (strftime('%Y-%m-%dT%H:%M:%SZ', 'now')),4343- updated_at timestamp not null default (strftime('%Y-%m-%dT%H:%M:%SZ', 'now')),4444- finished_at timestamp,4545-4646- primary key (rkey)3636+ nsid text not null,3737+ event text not null, -- json3838+ created integer not null -- unix nanos4739 );4840 `)4941 if err != nil {