mirror of
https://github.com/chatfire-AI/huobao-drama.git
synced 2026-08-28 18:07:48 +08:00
chore(docker): init.sql 同步分镜字段收敛后的新 schema
- 重新导出:17 张表(agent_configs 已移除)、种子 5 条 - 导出脚本适配 mysql-schema 精简(backfill/drop/cleanup 语句组已删除) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
/**
|
||||
* 导出初始化 SQL — 把 src/db/mysql-schema.ts 中的内嵌 DDL/种子生成为独立 init.sql
|
||||
* 导出初始化 SQL — 把 src/db/mysql-schema.ts 中的内嵌 DDL/DML 生成为独立 init.sql
|
||||
*
|
||||
* 用法: npx tsx scripts/export-init-sql.ts [输出路径]
|
||||
* 默认输出: <repo>/docker/init.sql
|
||||
*
|
||||
* 说明:
|
||||
* - 应用启动时本就会自动执行同样的初始化(initMySqlSchema: 建表 + 种子),该文件是可选产物,
|
||||
* - 应用启动时本就会自动执行同样的初始化(initMySqlSchema),该文件是可选产物,
|
||||
* 用于 DBA 审核、预建表或挂到 MySQL 容器的 /docker-entrypoint-initdb.d/
|
||||
*/
|
||||
import fs from 'fs'
|
||||
|
||||
+6
-6
@@ -1,7 +1,7 @@
|
||||
-- ============================================================================
|
||||
-- Huobao Drama 初始化 SQL
|
||||
-- 由 backend/scripts/export-init-sql.ts 从 backend/src/db/mysql-schema.ts 生成
|
||||
-- 生成时间: 2026-08-08T15:00:54.313Z
|
||||
-- 生成时间: 2026-08-08T15:10:25.386Z
|
||||
--
|
||||
-- 注意: 应用启动时会自动执行同等初始化(幂等),本文件不是部署必需,
|
||||
-- 仅供 DBA 审核或在应用外预建表使用
|
||||
@@ -296,8 +296,8 @@ CREATE TABLE IF NOT EXISTS assets (
|
||||
-- ----------------------------------------------------------------------------
|
||||
-- 2. 种子数据: 风格预设(幂等,只补缺失行)
|
||||
-- ----------------------------------------------------------------------------
|
||||
INSERT INTO `style_presets` (`name`, `value`, `prompt`, `description`, `sort_order`, `is_active`, `created_at`, `updated_at`) SELECT '3D 漫剧', '3d', '3D CG animation style, game-engine quality render, semi-realistic stylized characters, refined facial features, detailed materials and textures, cinematic lighting, high detail', '游戏引擎级 3D 渲染,半写实角色,当前短剧主流的 3D 漫剧质感', 1, 1, '2026-08-08T15:00:54.312Z', '2026-08-08T15:00:54.313Z' FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `style_presets` WHERE `value` = '3d');
|
||||
INSERT INTO `style_presets` (`name`, `value`, `prompt`, `description`, `sort_order`, `is_active`, `created_at`, `updated_at`) SELECT '日漫赛璐璐', 'anime', 'Japanese anime style, cel shading, clean crisp line art, vivid saturated colors, expressive character designs, detailed painted backgrounds', '日式赛璐璐动画风格', 2, 1, '2026-08-08T15:00:54.313Z', '2026-08-08T15:00:54.313Z' FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `style_presets` WHERE `value` = 'anime');
|
||||
INSERT INTO `style_presets` (`name`, `value`, `prompt`, `description`, `sort_order`, `is_active`, `created_at`, `updated_at`) SELECT '吉卜力手绘', 'ghibli', 'Studio Ghibli style, hand-drawn animation, soft watercolor painted backgrounds, warm nostalgic lighting, gentle natural palette, whimsical cozy atmosphere', '吉卜力手绘治愈风', 3, 1, '2026-08-08T15:00:54.313Z', '2026-08-08T15:00:54.313Z' FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `style_presets` WHERE `value` = 'ghibli');
|
||||
INSERT INTO `style_presets` (`name`, `value`, `prompt`, `description`, `sort_order`, `is_active`, `created_at`, `updated_at`) SELECT '水彩绘本', 'watercolor', 'watercolor illustration style, soft translucent washes, visible paper texture, delicate fluid brushwork, light airy atmosphere, hand-painted storybook feel', '水彩插画质感', 4, 1, '2026-08-08T15:00:54.313Z', '2026-08-08T15:00:54.313Z' FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `style_presets` WHERE `value` = 'watercolor');
|
||||
INSERT INTO `style_presets` (`name`, `value`, `prompt`, `description`, `sort_order`, `is_active`, `created_at`, `updated_at`) SELECT '美式漫画', 'comic', 'Western comic book style, bold black ink outlines, halftone dot shading, dynamic saturated colors, dramatic contrast lighting, flat graphic novel look', '美式漫画粗线条风格', 5, 1, '2026-08-08T15:00:54.313Z', '2026-08-08T15:00:54.313Z' FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `style_presets` WHERE `value` = 'comic');
|
||||
INSERT INTO `style_presets` (`name`, `value`, `prompt`, `description`, `sort_order`, `is_active`, `created_at`, `updated_at`) SELECT '3D 漫剧', '3d', '3D CG animation style, game-engine quality render, semi-realistic stylized characters, refined facial features, detailed materials and textures, cinematic lighting, high detail', '游戏引擎级 3D 渲染,半写实角色,当前短剧主流的 3D 漫剧质感', 1, 1, '2026-08-08T15:10:25.385Z', '2026-08-08T15:10:25.386Z' FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `style_presets` WHERE `value` = '3d');
|
||||
INSERT INTO `style_presets` (`name`, `value`, `prompt`, `description`, `sort_order`, `is_active`, `created_at`, `updated_at`) SELECT '日漫赛璐璐', 'anime', 'Japanese anime style, cel shading, clean crisp line art, vivid saturated colors, expressive character designs, detailed painted backgrounds', '日式赛璐璐动画风格', 2, 1, '2026-08-08T15:10:25.386Z', '2026-08-08T15:10:25.386Z' FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `style_presets` WHERE `value` = 'anime');
|
||||
INSERT INTO `style_presets` (`name`, `value`, `prompt`, `description`, `sort_order`, `is_active`, `created_at`, `updated_at`) SELECT '吉卜力手绘', 'ghibli', 'Studio Ghibli style, hand-drawn animation, soft watercolor painted backgrounds, warm nostalgic lighting, gentle natural palette, whimsical cozy atmosphere', '吉卜力手绘治愈风', 3, 1, '2026-08-08T15:10:25.386Z', '2026-08-08T15:10:25.386Z' FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `style_presets` WHERE `value` = 'ghibli');
|
||||
INSERT INTO `style_presets` (`name`, `value`, `prompt`, `description`, `sort_order`, `is_active`, `created_at`, `updated_at`) SELECT '水彩绘本', 'watercolor', 'watercolor illustration style, soft translucent washes, visible paper texture, delicate fluid brushwork, light airy atmosphere, hand-painted storybook feel', '水彩插画质感', 4, 1, '2026-08-08T15:10:25.386Z', '2026-08-08T15:10:25.386Z' FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `style_presets` WHERE `value` = 'watercolor');
|
||||
INSERT INTO `style_presets` (`name`, `value`, `prompt`, `description`, `sort_order`, `is_active`, `created_at`, `updated_at`) SELECT '美式漫画', 'comic', 'Western comic book style, bold black ink outlines, halftone dot shading, dynamic saturated colors, dramatic contrast lighting, flat graphic novel look', '美式漫画粗线条风格', 5, 1, '2026-08-08T15:10:25.386Z', '2026-08-08T15:10:25.386Z' FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM `style_presets` WHERE `value` = 'comic');
|
||||
|
||||
Reference in New Issue
Block a user