/**
Source Server Version: 8.0.31
Source Database: backendsys
Date: 2025/06/03 10:09:22
*/

DROP TABLE IF EXISTS `drama_project_settings`;
CREATE TABLE `drama_project_settings` (
    PRIMARY KEY (`id`),
    `id` BIGINT NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `drama_project_id` BIGINT NOT NULL COMMENT '项目ID',
    `drama_project_setting_type` INT NOT NULL COMMENT '项目配置类型 (1: 生图配置, 2: 生视频配置)',
    `aspect_ratio` VARCHAR(10) COMMENT '画面比例 (枚举)(16:9 - 1280*720, 9:16 - 720*1280, 1:1 - 1024*1024)',
    `model_id` BIGINT COMMENT '基础模型ID (固定值接口)(1: F.1-dev.safetensors)',
    `lora_style_id` BIGINT COMMENT '风格LoRA ID',
    `lora_style_strength` FLOAT COMMENT '风格强度 (默认值：1，范围：0~2.0，保留小数点后一位)',
    INDEX `idx_model_id` (`model_id`),
    INDEX `idx_lora_style_id` (`lora_style_id`),
    INDEX `idx_drama_project_id` (`drama_project_id`)
) ENGINE=INNODB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='短剧创作-项目配置表';

/*
 当配置类型为生图配置时，aspect_ratio、drama_base_model_id、drama_lora_style_id、drama_lora_style_strength 为必填项
 当配置类型为生视频配置时，aspect_ratio 为必填项
 */

INSERT INTO drama_project_settings(drama_project_id, drama_project_setting_type, aspect_ratio, model_id, lora_style_id, lora_style_strength) VALUES
    (1, 1, '16:9', 1, 1, 1),
    (1, 2, '16:9', null, null, null)
;
