Files
1818web-hoduan/V4__add_image_fields_to_ai_task.sql
2025-11-14 17:41:15 +08:00

22 lines
1005 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.

-- ============================================================
-- V4: 为AI任务表添加图片参数支持
-- 描述: 支持图生视频功能,允许用户上传参考图片
-- 作者: 1818AI
-- 日期: 2025-10-20
-- ============================================================
-- 添加图片相关字段到ai_task表
ALTER TABLE `ai_task`
ADD COLUMN `image_url` VARCHAR(500) NULL COMMENT '参考图片URL用于图生视频' AFTER `prompt`,
ADD COLUMN `image_base64` TEXT NULL COMMENT '参考图片Base64编码用于图生视频' AFTER `image_url`,
ADD COLUMN `aspect_ratio` VARCHAR(10) NULL COMMENT '图片宽高比如2:3, 3:2, 1:1' AFTER `image_base64`;
-- 添加索引以优化查询性能
CREATE INDEX `idx_task_type` ON `ai_task`(`task_type`);
-- 记录迁移日志
INSERT INTO `migration_log` (`version`, `description`, `executed_at`)
VALUES ('V4', '为AI任务表添加图片参数支持图生视频功能', NOW())
ON DUPLICATE KEY UPDATE `executed_at` = NOW();