-- ============================================================
-- 修复AI任务的task_type字段
-- 描述: 将ai_task表中的task_type从points_config表中同步过来
-- 作者: 1818AI  
-- 日期: 2025-10-23
-- ============================================================

USE `1818ai`;

-- 更新ai_task表的task_type字段，从points_config表中获取正确的值
UPDATE ai_task a 
INNER JOIN points_config p ON a.model_name = p.model_name 
SET a.task_type = p.task_type 
WHERE a.task_type IN ('unknown', 'video', 'image', 'other') 
  AND p.task_type IS NOT NULL 
  AND p.task_type != '';

-- 查看更新结果
SELECT 
    model_name, 
    task_type, 
    COUNT(*) as count 
FROM ai_task 
GROUP BY model_name, task_type 
ORDER BY model_name;
