-- 清除失败任务的SQL脚本
-- 数据库：aigc_platform

-- 1. 清除任务队列中的失败任务
DELETE FROM task_queue WHERE status = 'FAILED';

-- 2. 清除文生视频任务中的失败任务
DELETE FROM text_to_video_tasks WHERE status = 'FAILED';

-- 3. 清除图生视频任务中的失败任务
DELETE FROM image_to_video_tasks WHERE status = 'FAILED';

-- 4. 清除分镜视频任务中的失败任务
DELETE FROM storyboard_video_tasks WHERE status = 'FAILED';

-- 查看删除结果（可选）
-- SELECT COUNT(*) as failed_queue_tasks FROM task_queue WHERE status = 'FAILED';
-- SELECT COUNT(*) as failed_text_tasks FROM text_to_video_tasks WHERE status = 'FAILED';
-- SELECT COUNT(*) as failed_image_tasks FROM image_to_video_tasks WHERE status = 'FAILED';
-- SELECT COUNT(*) as failed_storyboard_tasks FROM storyboard_video_tasks WHERE status = 'FAILED';
