5 Commits

Author SHA1 Message Date
Yuyao Huang
427f62acca fix: handle foreign key constraint when deleting tasks with selected_task_id refs
Goals table has selected_task_id referencing tasks(id) without
ON DELETE SET NULL. When deleting a task, first clear any
selected_task_id references in goals to prevent FK violation.

Also update schema for future databases.
2026-05-09 13:05:53 +08:00
Yuyao Huang
2a3482c2c0 fix: prevent UNIQUE constraint race with gunicorn multi-worker
Use INSERT OR IGNORE instead of SELECT-then-INSERT for
default admin user creation, avoiding the race condition
when multiple gunicorn workers initialize simultaneously.
2026-05-09 10:19:58 +08:00
Yuyao Huang
3c325bdb0f feat(notes): add notes feature with CRUD operations and UI
- Implement notes database schema and API endpoints
- Add notes page with filtering, search, and markdown support
- Persist selected goal and task preferences for better UX
- Include responsive design and mobile-friendly layout
2026-05-08 17:42:42 +08:00
Yuyao Huang
a5c5f5b077 Remove db.json migration logic 2026-05-08 16:23:00 +08:00
Yuyao Huang
a8fe6ed7b3 Migrate from TinyDB to SQLite
- Replace TinyDB (JSON file) with sqlite3 for data persistence
- Add schema.py: table creation + data migration from db.json
- Rewrite database.py: all CRUD operations use sqlite3 directly
- All data retains original IDs via migration script
- Remove tinydb dependency from pyproject.toml
2026-05-08 16:18:26 +08:00