feat: Add migration functionality to update template-based tasks and set custom_max_wait_days to NULL

This commit is contained in:
Chop
2025-06-03 21:28:33 +02:00
parent 330744daf9
commit e136c9f0e8
2 changed files with 66 additions and 3 deletions

View File

@@ -60,10 +60,10 @@ export function getProjectTasks(projectId) {
// Create a new project task
export function createProjectTask(data) {
if (data.task_template_id) {
// Creating from template
// Creating from template - explicitly set custom_max_wait_days to NULL so COALESCE uses template value
const stmt = db.prepare(`
INSERT INTO project_tasks (project_id, task_template_id, status, priority)
VALUES (?, ?, ?, ?)
INSERT INTO project_tasks (project_id, task_template_id, custom_max_wait_days, status, priority)
VALUES (?, ?, NULL, ?, ?)
`);
return stmt.run(
data.project_id,