feat: add favorites table, CRUD commands, and Pinia store

This commit is contained in:
Your Name
2026-02-18 02:02:57 +02:00
parent 68ce724980
commit 6892bf8b98
4 changed files with 132 additions and 0 deletions

View File

@@ -158,6 +158,19 @@ pub fn init_db(conn: &Connection) -> Result<(), rusqlite::Error> {
[],
)?;
conn.execute(
"CREATE TABLE IF NOT EXISTS favorites (
id INTEGER PRIMARY KEY AUTOINCREMENT,
project_id INTEGER NOT NULL,
task_id INTEGER,
description TEXT,
sort_order INTEGER DEFAULT 0,
FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE,
FOREIGN KEY (task_id) REFERENCES tasks(id) ON DELETE SET NULL
)",
[],
)?;
conn.execute(
"CREATE TABLE IF NOT EXISTS settings (
key TEXT PRIMARY KEY,