build(db): 初始化本地依赖与 Prisma 基线

提供 PG18/Redis7.4/S3 本地 compose、环境变量样例与 Prisma 首版迁移;建立 outbox_events、idempotency_keys、system_configs 三张平台骨架表及幂等种子。MinIO 镜像不可得,本地以 S3Mock 替代。
This commit is contained in:
Stev_Wang committed 2026-11-02 17:20:32 +08:00
1 parent b3a2a843bb
commit 09dbb27b66
8 files changed
+377

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
# 种子数据状态(A0)
A0-INF-02 的计划要求种子包含「超管、示例角色、核心字典、电商行业包占位」。但这四类数据依赖的用户 / 角色 / 字典 / 行业包表分别在 A1(identity)、A3(industry)、A4(catalog)与 B0 批次才建表,A0 阶段提前建表会越过批次边界、造成后续迁移冲突。
A0 的处理:
- 已 seed(`prisma/seed.ts`):`system_configs` 中平台级配置项,按 `config_key` 幂等 upsert,重复执行不重复插入、不覆盖人工调整值。
- 待后续批次接入(保持 TODO,不在 A0 建表):
| 种子 | 依赖批次 | 说明 |
| -------------------------------- | ----------- | ------------------------------------------------------------------------ |
| 超级管理员账号 | A1 identity | 需 `users` / `user_roles` 表 |
| 示例角色与权限点 | A2 identity | 需 `roles` / `role_permissions` 表,权限点常量已在 `@lingxi/shared` 定义 |
| 核心字典(素材类型、脚本状态等) | A4 catalog | 需 `dict_types` / `dict_items` 表 |
| 电商行业包占位 | A3 industry | 需 `industry_packs` 表与行业包 schema |
> 【待确认 Q-A0-01】开发计划 A0-INF-02 的种子验收与批次建表顺序冲突,A0 按「只种已建表数据」执行,待产品/架构确认是否调整该 WBS 描述。