fix: schema_compat 跳过不存在的表,避免 columnPatch 对缺失表 panic
Build docker and publish / build (20.15.1) (push) Successful in 7m33s

Co-Authored-By: claude-flow <ruv@ruv.net>
This commit is contained in:
2026-03-11 11:33:21 -07:00
parent 772c12f821
commit b3c721ee58
2 changed files with 10 additions and 2 deletions
+8
View File
@@ -138,6 +138,14 @@ func EnsureSchemaCompatibility(ctx *svc.ServiceContext) error {
}
for _, patch := range columnPatches {
tblExists, err := tableExists(ctx.DB, patch.table)
if err != nil {
return errors.Wrapf(err, "check table %s failed", patch.table)
}
if !tblExists {
logger.Infof("[SchemaCompat] skipping column patch %s.%s: table does not exist", patch.table, patch.column)
continue
}
exists, err := columnExists(ctx.DB, patch.table, patch.column)
if err != nil {
return errors.Wrapf(err, "check column %s.%s failed", patch.table, patch.column)