feat: implement 'not_started' task status with validation and UI updates
This commit is contained in:
@@ -71,7 +71,7 @@ export default function initializeDatabase() {
|
||||
task_template_id INTEGER,
|
||||
custom_task_name TEXT,
|
||||
custom_max_wait_days INTEGER DEFAULT 0,
|
||||
status TEXT NOT NULL DEFAULT 'pending',
|
||||
status TEXT NOT NULL DEFAULT 'not_started' CHECK(status IN ('not_started', 'pending', 'in_progress', 'completed', 'cancelled')),
|
||||
date_added TEXT DEFAULT CURRENT_TIMESTAMP,
|
||||
priority TEXT DEFAULT 'normal',
|
||||
FOREIGN KEY (project_id) REFERENCES projects(project_id),
|
||||
@@ -279,6 +279,18 @@ export default function initializeDatabase() {
|
||||
// Column already exists, ignore error
|
||||
}
|
||||
|
||||
// Migration: Update task status system - add 'not_started' status
|
||||
try {
|
||||
// First, update all existing 'pending' tasks to 'not_started'
|
||||
db.exec(`
|
||||
UPDATE project_tasks SET status = 'not_started' WHERE status = 'pending';
|
||||
`);
|
||||
// Note: CHECK constraint will be applied when recreating the table in future migrations
|
||||
// For now, we'll rely on application-level validation
|
||||
} catch (e) {
|
||||
// Migration already done, ignore error
|
||||
}
|
||||
|
||||
// Create indexes for notes user tracking
|
||||
try {
|
||||
db.exec(`
|
||||
|
||||
Reference in New Issue
Block a user