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

SQLite · SQLAlchemy ORM · 38 实体表 + 1 关联表 · 34 枚举
6
内容核心
5
角色系统
4
数字人中心
3
工作流引擎
3
小说中心
2
广播剧中心

内容核心 6 表

project
Project项目/世界观
项目根对象。名称、类型、风格、目标集数、状态。关联所有子实体。
id · project_id(UUID) · name · description · project_type · style · target_episodes · status · config(JSON) · thumbnail · created_at · updated_at · deleted_at
episode
Episode剧集
剧集。标题、摘要、大纲、剧本原始内容、目标分镜数/时长,含多维管线状态字段。
id · project_id · episode_number · title · summary · outline · script_content · target_scenes · status · script_status/review_status/continuity_status/resource_status/shots_status/video_status/voice_status/export_status · created_at · updated_at · deleted_at
script
Script剧本
独立剧本表,替代 Episode.script_content。支持 comic/novel/audio/human 四种格式。
id · episode_id · project_id · title · format_type · content · outline · status · word_count · version · created_at · updated_at
scene
Scene场景
场景。位置、类型(indoor/outdoor)、时段、天气、布局、日/夜景图、Prompt。
id · project_id · name · description · location · scene_type · time_of_day · weather · layout_json · day_image_url · night_image_url · cover_asset_id · prompt_text · tags · version · is_active · created_at · updated_at · deleted_at
shot
Shot分镜
分镜。镜头类型(wide/medium/close/extreme_close)、运镜(static/pan/tilt/dolly/zoom)、台词、关联场景、生成prompt、图片/视频URL。
id · episode_id · shot_number · description · dialogue · shot_type · camera_movement · duration · character_ids · scene_id · prompt · image_url · video_url · status · created_at · updated_at
shot_character
ShotCharacter分镜-角色关联表
多对多关联。支持多个角色出现在同一分镜中。
shot_id · character_id · created_at

角色系统 5 表

character
Character角色
角色。名称、类型(protagonist/supporting/antagonist)、性别、年龄、性格/背景/外貌/服装设定、三视图、声音克隆参考音频。
id · project_id · name · role/gender · age · description · personality · backstory · appearance · clothing · tags · character_code · avatar_asset_id · front/side/back_image_url · voice_reference_path/text · voice_gender_age_profile · version · is_active · created_at · updated_at · deleted_at
character_version
CharacterVersion角色版本
角色图片版本记录。不同版本/不同角度的角色生成图。
id · character_id · version · image_type · image_url · prompt_used · seed · created_at
character_memory
CharacterMemory角色记忆
角色记忆。键值对存储角色在剧情中的经历、事件、关系变化。
id · character_id · episode_id · memory_key · memory_value · memory_type · created_at · updated_at
character_relation
CharacterRelation角色关系
角色关系图谱。关系类型描述、强度0-100、关联剧集。
id · project_id · from_character_id · to_character_id · relation_type · description · strength · status · episode_id · created_at · updated_at · deleted_at
prop
Prop道具
道具库。类型、时代、外观描写、剧情作用、参考图、所属角色。
id · project_id · prop_code · name · prop_type · era · description · appearance · function · plot_role · prompt_text · reference_image · owner_character_id · cover_asset_id · tags · visibility · usage_count · status · version · created_at · updated_at · deleted_at

资产 & 道具使用 3 表

asset
Asset统一资产表
统一资产表。全类型资产(image/video/audio/subtitle/workflow/prompt)、状态、文件元数据(尺寸/时长/帧率/种子/Prompt/模型)。支持 prompt_hash 精确去重。
id · asset_id(UUID) · project/episode/character/scene/shot_id · asset_type · status · asset_name · file_path · version · file_size · mime_type · width/height · duration · fps · seed · prompt · model_name · prompt_hash · extra_metadata · created_at · updated_at · deleted_at
prop_usage
PropUsage道具使用记录
道具在具体分镜/场景中的使用记录,含连续性状态追踪。
id · prop_id · project/episode/shot/scene_id · usage_note · continuity_state · created_at
resource_requirement
ResourceRequirement资源需求
资源需求匹配。从剧本提取 character/scene/prop 需求,状态:unmatched → matched → created。
id · project_id · episode_id · resource_type · name · description · status · matched_resource_id/name · created_at · updated_at · deleted_at

制作系统 7 表

workflow
Workflow工作流定义
DAG 工作流模板。名称、描述、DAG结构JSON。
id · workflow_id(UUID) · name · description · dag_json · status · version · created_at · updated_at · deleted_at
workflow_instance
WorkflowInstance工作流实例
工作流运行时实例。状态(pending→running→success/failed/paused/cancelled)、进度、参数/结果JSON。
id · instance_id(UUID) · workflow_id · project/episode_id · status · progress · params_json · result_json · error_message · started_at · finished_at · created_at · updated_at
workflow_node
WorkflowNode工作流节点
DAG 中单个节点运行记录。类型(agent/workflow/task)、输入/输出JSON、支持回滚状态。
id · instance_id · node_id · node_type · node_name · status · input_json · output_json · error_message · started_at · finished_at · created_at · updated_at
task
Task任务
统一任务队列。类型(SCRIPT_GENERATE/IMAGE_GENERATE等)、优先级、状态、重试、Worker分配。
id · task_id(UUID) · task_type · priority(HIGH/NORMAL/LOW) · project/episode/shot_id · status · params_json · result_json · error_message · retry_count · max_retries · progress · worker_id · requested_by · started_at · finished_at · created_at · updated_at
task_log
TaskLog任务日志
任务执行日志。级别(DEBUG/INFO/WARN/ERROR)。
id · task_id · log_level · message · created_at
prompt
PromptPrompt 模板
结构化 Prompt 管理。5层级(global/project/character/scene/shot)、正面/负面Prompt、版本控制。
id · prompt_id(UUID) · project_id · prompt_layer · layer_key · prompt_text · negative_prompt · tags · status · version · created_by · created_at · updated_at · deleted_at
prompt_version
PromptVersionPrompt 版本
Prompt 版本历史。含变更日志。
id · prompt_id · version · prompt_text · negative_prompt · change_log · created_by · created_at

场景版本 1 表

scene_version
SceneVersion场景版本
场景图片版本记录。不同版本/不同时段(day/night/layout)的场景生成图。
id · scene_id · version · image_type · image_url · prompt_used · seed · created_at

知识系统 2 表

knowledge
Knowledge知识条目
知识条目。6类型(fact/concept/relation/event/timeline/director_case)、可信度、审核流程(draft→approved→published)、向量化状态。
id · knowledge_id(UUID) · project_id · knowledge_type · title · content · source_type/url · category · tags · confidence · status · embedding_status · review_level · reviewer_comment · published_at · created_by · created_at · updated_at · deleted_at
knowledge_graph_edge
KnowledgeGraphEdge知识图谱边
知识图谱有向边。关系类型(is_a/part_of/causes/related_to)、权重。
id · project_id · from_knowledge_id · to_knowledge_id · relation_type · weight · created_at

时间线 & 营销 2 表

timeline_event
TimelineEvent时间线事件
项目时间线。事件顺序、剧情内时间、涉及角色/道具、重要性、类型。
id · project/episode/shot_id · event_code · title · description · event_order · story_time · location · character_ids · prop_ids · event_type · importance · status · extra_metadata · created_at · updated_at · deleted_at
marketing_material
MarketingMaterial营销素材
营销素材。类型、目标平台、格式、发布状态、文件路径。
id · project/episode_id · material_type · title · description · target_platform · content_format · status · published · file_path · published_url · result_json · extra_metadata · created_at · updated_at · deleted_at

用户系统 2 表

user
User用户
用户账号。用户名、密码哈希、显示名、邮箱、头像、通知偏好。
id · username · hashed_password · display_name · email · avatar_url · allow_notifications · is_active · role · created_at · updated_at
user_session
UserSession用户会话
用户登录会话。Token、过期时间。
id · user_id · token · expires_at · created_at

小说中心 3 表

novel
Novel小说项目
小说项目。标题、描述、来源剧本、状态(draft→generating→completed)、字数/卷数/章数统计。
id · project_id · title · description · source_script_id · status · total_words/volumes/chapters · created_at · updated_at
novel_volume
NovelVolume小说卷
小说卷。卷号、标题、大纲。
id · novel_id · volume_number · title · outline · status · created_at · updated_at
novel_chapter
NovelChapter小说章
小说章。章号、标题、大纲、正文、字数、状态(pending→generating→completed→reviewed)。
id · novel_id · volume_id · chapter_number · title · outline · content · word_count · status · created_at · updated_at

广播剧中心 2 表

audio_drama
AudioDrama广播剧项目
广播剧项目。来源类型(独立/漫剧导入)、状态(draft→script_loaded→cast_assigned→generating→mixing→completed→exported)、混音成品资产。
id · project_id · title · description · source_script_id · source_type · status · duration_minutes · mix_asset_id · created_at · updated_at
audio_drama_track
AudioDramaTrack广播剧音轨
音轨。类型(dialogue/narration/sound_effect/bgm)、角色绑定、台词内容、音量、生成状态。
id · audio_drama_id · track_type · character_id · asset_id · sequence · content · duration_seconds · volume · generation_status · error_message · created_at

数字人中心 4 表

digital_human
DigitalHuman数字人
数字人形象。关联角色、立绘/声音/驱动视频/场景背景资产、模板配置。
id · name · character_id/project_id · image/voice/driving_video/scene_background_asset_id · template_config · description · status · created_at · updated_at
digital_human_script
DigitalHumanScript数字人口播脚本
口播脚本。原始文本(含提示标记)、状态(draft→ready→generating→completed)。
id · digital_human_id · title · raw_content · status · created_at · updated_at
digital_human_video
DigitalHumanVideo数字人视频
数字人驱动视频。关联口播脚本、语音/视频/口型资产、多镜头组合。
id · digital_human_id · script_id · audio/video/lip_sync_asset_id · title · content · status · duration_seconds · created_at · updated_at
digital_human_shot
DigitalHumanShot数字人镜头
口播镜头分段。表情/动作/镜头提示、音频/口型资产、状态(pending→voice_ready→lipsync_ready→completed)。
id · script/digital_human/video_id · sequence · content · emotion_hint · action_hint · shot_hint · audio/video_asset_id · status · duration_seconds · created_at · updated_at

格式转换 & 翻译 2 表

script_conversion
ScriptConversion格式转换记录
跨格式剧本转换。方式(llm/direct)、状态追踪。
id · source_script_id · target_script_id · source_format · target_format · conversion_type · status · error_message · created_at · completed_at
translation_job
TranslationJob翻译任务
多语种翻译任务。源/目标语言、范围(dialogue/action/full)、原文/译文预览。
id · project/episode_id · source_language · target_language · scope · status · source_preview · translation_preview · error_message · created_by · created_at · completed_at

枚举 34 枚举

内容核心

ProjectStatus draft / active / archived / deleted ProjectType series / science / knowledge EpisodeStatus pending / generating / success / failed ShotType wide / medium / close / extreme_close CameraMovement static / pan / tilt / dolly / zoom FormatType comic / novel / audio / human ScriptStatus draft / confirmed / archived

角色系统

CharacterRole protagonist / supporting / antagonist Gender male / female / unknown

资产

AssetType character_image / scene_image / shot_image / prop_image / shot_video / lipsync_video / episode_video / audio / voice / music / subtitle / workflow_json / prompt_template AssetStatus pending / processing / ready / failed / deleted

制作系统

WorkflowStatus active / inactive / archived InstanceStatus pending / running / success / failed / paused / cancelled NodeStatus pending / running / success / failed / skipped / rolling_back / rolled_back TaskStatus pending / running / success / failed / retrying / cancelled TaskPriority HIGH(1) / NORMAL(5) / LOW(10) PromptLayer global / project / character / scene / shot PromptStatus draft / active / archived

知识系统

KnowledgeType fact / concept / relation / event / timeline / director_case KnowledgeStatus draft / pending_review / approved / rejected / published ReviewLevel ai / expert / publish

营销

MarketingMaterialStatus draft / generating / ready / failed

小说中心

NovelStatus draft / generating / completed / archived ChapterStatus pending / generating / completed / reviewed

广播剧中心

AudioDramaStatus draft / script_loaded / cast_assigned / generating / mixing / completed / exported / failed TrackType dialogue / narration / sound_effect / bgm TrackGenerationStatus pending / generating / success / failed / skipped

数字人中心

DigitalHumanStatus creating / active / archived VideoStatus pending / generating / completed / failed DHScriptStatus draft / ready / generating / completed DHShotStatus pending / voice_ready / lipsync_ready / completed / failed

格式转换 & 翻译

ConversionType llm / direct ConversionStatus pending / processing / completed / failed TranslationJobStatus pending / processing / completed / failed / partial