feat: Add user tracking to project tasks and notes
- Implemented user tracking columns in project_tasks and notes tables. - Added created_by and assigned_to fields to project_tasks. - Introduced created_by field and is_system flag in notes. - Updated API endpoints to handle user tracking during task and note creation. - Enhanced database initialization to include new columns and indexes. - Created utility functions to fetch users for task assignment. - Updated front-end components to display user information for tasks and notes. - Added tests for project-tasks API endpoints to verify functionality.
This commit is contained in:
25
check-task-schema.mjs
Normal file
25
check-task-schema.mjs
Normal file
@@ -0,0 +1,25 @@
|
||||
import Database from "better-sqlite3";
|
||||
|
||||
const db = new Database("./data/database.sqlite");
|
||||
|
||||
console.log("Project Tasks table structure:");
|
||||
const projectTasksSchema = db.prepare("PRAGMA table_info(project_tasks)").all();
|
||||
console.table(projectTasksSchema);
|
||||
|
||||
console.log("\nSample project tasks with user tracking:");
|
||||
const tasks = db
|
||||
.prepare(
|
||||
`
|
||||
SELECT pt.*,
|
||||
creator.name as created_by_name,
|
||||
assignee.name as assigned_to_name
|
||||
FROM project_tasks pt
|
||||
LEFT JOIN users creator ON pt.created_by = creator.id
|
||||
LEFT JOIN users assignee ON pt.assigned_to = assignee.id
|
||||
LIMIT 3
|
||||
`
|
||||
)
|
||||
.all();
|
||||
console.table(tasks);
|
||||
|
||||
db.close();
|
||||
Reference in New Issue
Block a user