···11+-- Task history table for undo functionality
22+CREATE TABLE IF NOT EXISTS task_history (
33+ id INTEGER PRIMARY KEY AUTOINCREMENT,
44+ task_id INTEGER NOT NULL,
55+ operation TEXT NOT NULL, -- 'update', 'delete'
66+ snapshot TEXT NOT NULL, -- JSON snapshot of task before operation
77+ created_at DATETIME DEFAULT CURRENT_TIMESTAMP
88+);
99+1010+CREATE INDEX IF NOT EXISTS idx_task_history_task_id ON task_history(task_id);
1111+CREATE INDEX IF NOT EXISTS idx_task_history_created_at ON task_history(created_at);