autotasker/migrations/all.sql

22 lines
758 B
MySQL
Raw Normal View History

2024-07-21 15:03:37 +00:00
DROP TABLE IF EXISTS task_runs;
CREATE TABLE task_runs (
2024-04-27 09:59:43 +00:00
id TEXT PRIMARY KEY,
task_id TEXT NOT NULL,
status TEXT CHECK(status IN ('pending','running','failed','success')) NOT NULL DEFAULT 'pending',
2024-07-21 15:03:37 +00:00
trigger_mode TEXT CHECK(trigger_mode IN ('manual','webhook','schedule')) NOT NULL DEFAULT 'manual',
2024-04-27 09:59:43 +00:00
exit_code INT,
runtime_details JSON,
2024-04-27 09:59:43 +00:00
submitted_at DATETIME,
started_at DATETIME,
2024-07-21 15:03:37 +00:00
ended_at DATETIME
);
DROP TABLE IF EXISTS logs_lines;
CREATE TABLE logs_lines (
id TEXT PRIMARY KEY,
task_run_id TEXT NOT NULL,
kind TEXT CHECK(kind IN ('Stdout', 'Stderr')),
captured_at INT, -- unix timestamp
content TEXT
)