Files
massive-cloud/drizzle/0012_inspection_task_created_status.sql

12 lines
414 B
SQL
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-- 检测任务新增 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;