feat: add inspection task lifecycle controls
This commit is contained in:
11
drizzle/0012_inspection_task_created_status.sql
Normal file
11
drizzle/0012_inspection_task_created_status.sql
Normal file
@@ -0,0 +1,11 @@
|
||||
-- 检测任务新增 created 初始状态;task_analysis_results.status 仍保留原有语义
|
||||
|
||||
ALTER TABLE `inspection_tasks`
|
||||
MODIFY COLUMN `status` ENUM('created','pending','processing','completed','error') NOT NULL DEFAULT 'created';
|
||||
|
||||
UPDATE `inspection_tasks` AS t
|
||||
LEFT JOIN `task_analysis_results` AS r
|
||||
ON r.`taskId` = t.`id`
|
||||
SET t.`status` = 'created'
|
||||
WHERE t.`status` = 'pending'
|
||||
AND r.`id` IS NULL;
|
||||
Reference in New Issue
Block a user