feat: add initial db connection and layout
This commit is contained in:
14
migrations/0001_initial.up.sql
Normal file
14
migrations/0001_initial.up.sql
Normal 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)
|
||||
);
|
||||
Reference in New Issue
Block a user