fix: schema_compat 跳过不存在的表,避免 columnPatch 对缺失表 panic
Build docker and publish / build (20.15.1) (push) Successful in 7m33s
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user