feat: 更新数据库时支持同步保存子表配置和DDL

- UpdateDatabaseRequest 添加 SubTables 字段
- 数据库更新时同步创建或更新子表记录
- 支持子表 DDL 的保存

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-07 10:33:30 +08:00
parent c917d6b04c
commit 2eddc53249
4 changed files with 75 additions and 15 deletions

View File

@@ -95,6 +95,7 @@ type CreateSubTableRequest struct {
RelationField string `json:"relation_field"`
RelationType string `json:"relation_type"`
Fields []FieldMapping `json:"fields"` // 字段映射列表
DDL string `json:"ddl"` // 建表DDL
}
// UpdateSubTableRequest 更新子表请求
@@ -105,6 +106,7 @@ type UpdateSubTableRequest struct {
MappingType string `json:"mapping_type"`
RelationField string `json:"relation_field"`
RelationType string `json:"relation_type"`
DDL string `json:"ddl"`
}
// SubTableMapping 完整的子表映射配置(存储到文件的格式)