ALTER TABLE `video_clips` ADD COLUMN `quality_status` VARCHAR(50) NULL AFTER `retry_count`, ADD COLUMN `quality_score` DECIMAL(5, 2) NULL AFTER `quality_status`, ADD COLUMN `quality_issues` JSON NULL AFTER `quality_score`; INSERT INTO `provider_configs` (`provider_type`, `provider_code`, `display_name`, `mode`, `model_name`, `config_json`, `is_enabled`, `priority`, `rate_limit_json`, `cost_rule_json`, `created_at`, `updated_at`) VALUES ( 'VideoProvider', 'runway-image-to-video', 'Runway Image-to-Video', 'real', 'gen4.5', JSON_OBJECT( 'driver', 'runway_image_to_video', 'api_key_env', 'RUNWAYML_API_SECRET', 'base_url', 'https://api.dev.runwayml.com', 'api_version', '2024-11-06', 'timeout_ms', 180000, 'create_endpoint', '/v1/image_to_video', 'task_endpoint_template', '/v1/tasks/{task_id}', 'poll_interval_ms', 10000, 'max_poll_attempts', 90, 'ratio', '720:1280', 'duration', 5, 'note', '默认禁用。启用后必须在业务侧显式确认真实视频生成,避免误扣费。' ), false, 40, JSON_OBJECT('rpm', 5, 'concurrency', 1), JSON_OBJECT( 'flat_cost', 0, 'unit', 'video_seconds', 'price_per_second', 0, 'currency', 'USD', 'max_cost_per_call', 0, 'daily_cost_limit', 0, 'note', '请按 Runway 实际账单填写 price_per_second 或单次/每日成本上限。' ), NOW(3), NOW(3) ), ( 'VideoProvider', 'kling-image-to-video', 'Kling Image-to-Video', 'real', 'kling-v3', JSON_OBJECT( 'driver', 'kling_image_to_video', 'api_key_env', 'KLING_API_KEY', 'base_url', 'https://api-singapore.klingai.com', 'timeout_ms', 180000, 'create_endpoint', '/v1/videos/image2video', 'task_endpoint_template', '/v1/videos/image2video/{task_id}', 'poll_interval_ms', 10000, 'max_poll_attempts', 90, 'image_field', 'image', 'prompt_field', 'prompt', 'duration_field', 'duration', 'aspect_ratio_field', 'aspect_ratio', 'aspect_ratio', '9:16', 'duration', 5, 'note', '默认禁用。不同 Kling 官方/网关接口字段可能不同,可在高级配置里调整字段名和 Base URL。' ), false, 40, JSON_OBJECT('rpm', 5, 'concurrency', 1), JSON_OBJECT( 'flat_cost', 0, 'unit', 'video_seconds', 'price_per_second', 0, 'currency', 'USD', 'max_cost_per_call', 0, 'daily_cost_limit', 0, 'note', '请按 Kling 实际账单填写 price_per_second 或单次/每日成本上限。' ), NOW(3), NOW(3) ) ON DUPLICATE KEY UPDATE `display_name` = VALUES(`display_name`), `mode` = VALUES(`mode`), `model_name` = VALUES(`model_name`), `priority` = VALUES(`priority`), `rate_limit_json` = VALUES(`rate_limit_json`), `updated_at` = NOW(3);