chore(A10 W1): 收敛重复 bootstrap,db/migration 成平台表 DDL 单一真相
W1 引入 db/migration/V1-V3 后,平台表 DDL 在迁移与各模块 bootstrap-*.sql 重复
(评审揪出的"易漂移")。本次收敛,db/migration 成唯一真相:
- 删 3 份重复 bootstrap:bootstrap-page-schema(=V1)/bootstrap-datastatus(=V2)/
bootstrap-ai-agent(=V3)。三者无运行态 classpath 消费者(已全仓核实)。
- AiAgentDdlTest(platform-ai,原读 bootstrap-ai-agent.sql)删除,等价覆盖迁入
platform-app 新增 PlatformMigrationDdlGuardTest:① 守 V3 声明全部 AI 平台表/索引;
② 守 SchemaImportCli.CREATE_DDL ≡ V1(独立 CLI 兜底 DDL 防漂移)。
- SchemaImportCli.CREATE_DDL 由包私有改 public 供上述 guard 比对;两处过时注释改指 V1。
- ci.sh 平台表预灌改指 db/migration/V1(注:app 启动 Flyway 已幂等建表,此预灌仅冗余兜底)。
- docs 对齐:AI_AGENT_AUTO_DEVELOPMENT(spring.sql.init→Flyway)、docs/sql/SYS_PAGE_SCHEMA
/SYS_AI_AGENT 头注释(待办→已落地)、A10 design 残留收敛标完成、deploy/README 残留项标完成。
边界:platform-parity 的 bootstrap-{sys,privilege,auth,xservice,multidim,flow}.sql 是
eip3 schema 对拍测试 fixture,非平台表副本,原样保留。
验证:全 reactor mvn clean install 绿;PlatformMigrationDdlGuardTest 2/2;独立 code-reviewer
评审 GO(零 CRITICAL/HIGH/MEDIUM,含 guard substring 逻辑对真实 V1 仿真核实)。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -4,11 +4,11 @@
|
||||
-- 归属:platform-ai(P5 Agent 开发底座)。
|
||||
-- 契约:/api/ai/tasks、/api/ai/tasks/{taskId}/drafts、change-sets、runs、audit。
|
||||
--
|
||||
-- 【Flyway 待办(P5)】
|
||||
-- 【Flyway 已落地(A10 W1,2026-06-25)】
|
||||
-- 架构条款(docs/架构设计.md §「平台表管理」):SYS_* 平台表由 Flyway 管理。
|
||||
-- 本工程当前未引入 Flyway。本脚本即「生产建表脚本」,P5 引入 Flyway 时
|
||||
-- 原样改名为 V{n}__create_sys_ai_agent.sql 纳入 src/main/resources/db/migration 即可。
|
||||
-- 本地 / CI 自举副本见 platform-ai/src/main/resources/bootstrap/bootstrap-ai-agent.sql。
|
||||
-- ✅ 已引入 Flyway。这些表【单一真相】= platform-app/src/main/resources/db/migration/V3__sys_ai_agent.sql
|
||||
-- (运行态由 Flyway 启动时幂等 migrate;内容与本脚本一致)。本文件保留为人读的生产建表参考。
|
||||
-- 原 bootstrap-ai-agent.sql 自举副本已删除(收敛入 V3)。
|
||||
--
|
||||
-- 边界:这些表只保存 AI 开发运行态和草稿。发布到 SYS_PAGE_SCHEMA / SYS_ENTITY /
|
||||
-- 服务流等生产元数据必须经过独立人审门禁,不能由 Agent 接口直接落生产。
|
||||
|
||||
@@ -4,12 +4,11 @@
|
||||
-- 归属:platform-metadata(页面 schema 服务化,P4-4)。
|
||||
-- 契约:GET /api/page/schema/{templateId} 的下发数据源。
|
||||
--
|
||||
-- 【Flyway 待办(P5)】
|
||||
-- 【Flyway 已落地(A10 W1,2026-06-25)】
|
||||
-- 架构条款(docs/架构设计.md §「平台表管理」):SYS_* 平台表由 Flyway 管理。
|
||||
-- 本工程当前未引入 Flyway。本脚本即「生产建表脚本」,P5 引入 Flyway 时
|
||||
-- 原样改名为 V{n}__create_sys_page_schema.sql 纳入 src/main/resources/db/migration 即可
|
||||
-- (内容无需改动,故此处保持 Flyway 友好:单条幂等 DDL,无数据)。
|
||||
-- 本地 / CI 自举副本见 platform-metadata/src/main/resources/bootstrap/bootstrap-page-schema.sql。
|
||||
-- ✅ 已引入 Flyway。本表【单一真相】= platform-app/src/main/resources/db/migration/V1__sys_page_schema.sql
|
||||
-- (运行态由 Flyway 启动时幂等 migrate;内容与本脚本一致)。本文件保留为人读的生产建表参考。
|
||||
-- 原 bootstrap-page-schema.sql 自举副本已删除(收敛入 V1)。
|
||||
--
|
||||
-- 初始数据导入(1489 个转换产物)由 SchemaImportCli 批量入库,不在本 DDL 内。
|
||||
-- ============================================================================
|
||||
|
||||
Reference in New Issue
Block a user