feat(library): 发布写入支持 WeKnora 0.9.0 schema 134
build / build (push) Successful in 1m54s

整库发布写入路径原先按 0.7.1 的固定表集合工作:0.9.0 没有 wiki_log_entries,
Current/清理/编目/整实例指纹都会在不存在表上失败,跨版本闸门也因快照丢掉
SchemaVersion 而失效(未知版本被当作 74)。

改为在装配时解析目标 profile,表集合与清理顺序按解析结果;快照复制与范围改写
带上 SchemaVersion/Profile;跨版本发布显式拒绝并同时点名两个版本。单文档发布包
仍只支持 0.7.1,但改为明确拒绝并说明原因。

本机隔离验证:真实 0.9.0 schema 源库→导出→封存→写入干净 134 目标→逐表核对→
写前镜像回滚;74→134 拒绝与 134 缺表不报错两个负例通过。make verify 17 项全绿。
This commit is contained in:
姚章浩
2026-11-16 20:42:23 +08:00
parent 10568943af
commit fba2713b4e
21 changed files with 630 additions and 56 deletions
@@ -525,7 +525,9 @@ func validObjectLocator(value string) bool {
}
func cloneSnapshot(snapshot PostgresSnapshot) PostgresSnapshot {
result := PostgresSnapshot{Tables: make([]TableSnapshot, len(snapshot.Tables))}
// 复制快照不得改契约:SchemaVersion/Profile 丢掉会让下游按未知版本(=0.7.1)处理。
result := PostgresSnapshot{Tables: make([]TableSnapshot, len(snapshot.Tables)),
SchemaVersion: snapshot.SchemaVersion, Profile: snapshot.Profile}
for index, table := range snapshot.Tables {
result.Tables[index] = table
result.Tables[index].Rows = append([]json.RawMessage(nil), table.Rows...)