feat: add created_by field to track task creators

main
brobert (aider) 3 months ago
parent 5f6c1ed82e
commit 60e5aea66f

@ -11,6 +11,7 @@ CREATE TABLE IF NOT EXISTS groups (
CREATE TABLE IF NOT EXISTS tasks (
id INTEGER PRIMARY KEY AUTOINCREMENT,
description TEXT NOT NULL,
created_by TEXT NOT NULL, -- WhatsApp phone number of task creator
assigned_to TEXT NOT NULL DEFAULT '', -- WhatsApp phone number (empty string if unassigned)
due_date TEXT, -- ISO 8601 date string (e.g., "2023-10-31")
completed BOOLEAN NOT NULL DEFAULT FALSE,

@ -11,8 +11,8 @@ export function createTask(sender: string, params: CreateTaskParams) {
}
const result = execute(
'INSERT INTO tasks (description, assigned_to, due_date, completed) VALUES (?, ?, ?, ?)',
[params.description.trim(), params.assignedTo || null, params.dueDate || null, false]
'INSERT INTO tasks (description, created_by, assigned_to, due_date, completed) VALUES (?, ?, ?, ?, ?)',
[params.description.trim(), sender, params.assignedTo || null, params.dueDate || null, false]
);
const task = getTaskById(result.lastInsertRowid);

Loading…
Cancel
Save