tas/src/repo/sqlite/schema.sql

25 lines
514 B
MySQL
Raw Normal View History

2022-08-16 23:36:50 +03:00
CREATE TABLE _tas_info (
version INTEGER PRIMARY KEY
);
CREATE TABLE tasks (
id INTEGER PRIMARY KEY,
name TEXT NOT NULL,
group TEXT NULL,
link TEXT NULL,
path TEXT NULL,
current BOOLEAN NOT NULL DEFAULT false,
created_at DATETIME NOT NULL DEFAULT datetime('now'),
finished_at DATETIME NULL
);
CREATE VIEW active_tasks AS (
SELECT *
FROM tasks
WHERE finished_at IS NULL
ORDER BY created_at
);