数据库表结构 影视梦工厂 v3.0

SQLite · SQLAlchemy ORM · v2 存量 29 表 + v3 新增 9 表 + 3 枚举
16
核心表
3
关联表
5
知识表
5
枚举 (v2)
9
新表 (v3)
3
新枚举 (v3)

内容核心 5 表

World
世界观。名称、描述、类型设定。
id · name · description · world_type · created_at
Character
角色。名称、性别、年龄、性格、外貌、背景、参考音频。
id · name · gender · age · personality · appearance · background · ref_audio · world_id
Episode
剧集。标题、剧情摘要、状态。
id · title · summary · status · episode_number · world_id
Scene
场景。位置、氛围、天气、时间。
id · name · location · atmosphere · weather · time_of_day · episode_id
Shot
分镜。镜头类型、运镜、台词、角色定位、状态。
id · scene_id · shot_type · camera_movement · dialogue · character_position · status · prompt_hash

资产 3 表

ShotAsset
分镜资产。图像、视频、音频、字幕文件路径。
id · shot_id · type · file_path · prompt_id · created_at
Prompt
Prompt 模板。名称、模板内容、模型适用。
id · name · template · model_type · variables
Prop
道具。名称、描述、源文本。
id · name · description · source_text · episode_id

制作 3 表

ProductionTask
制作任务。类型、状态、进度、关联分镜。
id · episode_id · type · status · progress · shot_id
Export
导出记录。格式、状态、文件路径、质量参数。
id · episode_id · format · status · file_path · quality · resolution
ExportTask
导出任务。与 Export 关联的制作任务。
id · task_id · export_id · status

系统 2 表

User
用户。用户名、密码哈希、角色。
id · username · password_hash · role
SystemConfig
系统配置。键值对。
id · key · value

关联表 3 表

shot_character
分镜-角色关联。支持多角色出现在同一分镜。
shot_id · character_id
script_knowledge
脚本-知识关联。脚本段落关联的知识条目。
script_id · knowledge_id
scene_character
场景-角色关联。场景中的角色列表。
scene_id · character_id

知识系统 5 表

Knowledge
知识条目。标题、内容、类型、向量、来源。
id · title · content · type · vector · source · created_at
KnowledgeTag
知识标签。标签名。
id · name
KnowledgeTagLink
知识-标签关联。
knowledge_id · tag_id
DirectorCase
导演案例。源视频路径、关键帧、导演技术分析、镜头类型、构图、运镜、光线。
id · source_video · keyframes · technique_analysis · shot_type · composition · camera_movement · lighting

v3 新增 9 表

Script
独立的剧本表。替代 Episode.script_content,支持多格式剧本。
id · episode_id · format_type(comic/novel/audio/human) · content · title · status · created_at · updated_at
Novel
小说项目。标题、描述、关联剧本和世界观。
id · project_id · title · description · status · source_script_id · world_id · created_at
NovelVolume
小说卷。卷号、标题、大纲、状态。
id · novel_id · volume_number · title · outline · status · created_at
NovelChapter
小说章。章号、标题、大纲、正文、字数、状态。
id · novel_id · volume_id · chapter_number · title · outline · content · word_count · status · created_at
AudioDrama
广播剧项目。标题、描述、时长、关联剧本。
id · project_id · title · description · status · source_script_id · duration_minutes · created_at
AudioDramaTrack
广播剧音轨。对白、旁白、音效、BGM 音轨。
id · audio_drama_id · track_type(dialogue/narration/sound_effect/bgm) · character_id · audio_asset_id · sequence · content · created_at
DigitalHuman
数字人。名称、形象资产、语音资产、关联角色。
id · name · image_asset_id · voice_asset_id · character_id · status · created_at
DigitalHumanVideo
数字人视频。数字人驱动的视频内容。
id · digital_human_id · script_id · audio_asset_id · video_asset_id · status · created_at
ScriptConversion
格式转换记录。跨格式剧本转换(LLM 或直接映射)。
id · source_script_id · target_script_id · source_format · target_format · conversion_type(llm/direct) · status · created_at

枚举 8 枚举

ShotType
分镜类型。WS(全景)/MS(中景)/CU(特写)/ECU(大特写)/OVS(过肩)/POV(主观)
ShotStatus
分镜状态。pending/confirmed/generating/done/failed
AssetType
资产类型。image/video/audio/subtitle
KnowledgeType
知识类型。script_director/science_knowledge/director_case
ExportStatus
导出状态。pending/processing/done/failed
FormatType
剧本格式。comic(漫画)/novel(小说)/audio(广播剧)/human(数字人)
TrackType
广播剧音轨类型。dialogue(对白)/narration(旁白)/sound_effect(音效)/bgm(背景音乐)
ConversionType
格式转换方式。llm(LLM 转换)/direct(直接映射)