feat: storing tasks runs in Sqlite DB

This commit is contained in:
Matthieu Bessat 2024-07-21 17:03:37 +02:00
parent 41443e5a7d
commit 0d322ee70c
12 changed files with 274 additions and 112 deletions

View file

@ -1,11 +1,12 @@
CREATE TABLE IF NOT EXISTS task_runs (
DROP TABLE IF EXISTS task_runs;
CREATE TABLE task_runs (
id TEXT PRIMARY KEY,
task_id TEXT NOT NULL,
status TEXT CHECK(status IN ('pending','running','failed','success')) NOT NULL DEFAULT 'pending',
trigger_mode TEXT CHECK(status IN ('manual','webhook','schedule')) NOT NULL,
trigger_mode TEXT CHECK(trigger_mode IN ('manual','webhook','schedule')) NOT NULL DEFAULT 'manual',
exit_code INT,
logs TEXT,
submitted_at DATETIME,
started_at DATETIME,
end_at DATETIME
)
ended_at DATETIME
);