feat: add initial db connection and layout

This commit is contained in:
2026-02-28 12:23:24 +01:00
parent 507cc7434e
commit 00bd396bbe
4 changed files with 175 additions and 2 deletions

View File

@@ -0,0 +1,2 @@
DROP TABLE IF EXISTS todo_tags;
DROP TABLE IF EXISTS todos;

View File

@@ -0,0 +1,14 @@
CREATE TABLE IF NOT EXISTS todos (
id INTEGER PRIMARY KEY AUTOINCREMENT,
text TEXT NOT NULL,
priority TEXT NOT NULL DEFAULT 'medium',
project TEXT,
created_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%SZ', 'now')),
completed_at TEXT
);
CREATE TABLE IF NOT EXISTS todo_tags (
todo_id INTEGER NOT NULL REFERENCES todos(id) ON DELETE CASCADE,
tag TEXT NOT NULL,
PRIMARY KEY (todo_id, tag)
);