feat: add Z12/Z13 bind APIs, stock import, and sync docs

Enable auto default sync channels on agent activate, bind-code/phone confirm flows, publish ALTER, and align admin/yuheng docs with the production bind path.
This commit is contained in:
whm
2026-08-05 11:47:20 +08:00
parent b04b180d30
commit cb56e6847e
31 changed files with 1882 additions and 91 deletions

View File

@@ -347,6 +347,26 @@ func (l *PublishLogic) Publish(slug string, req *types.PublishReq) (*types.Publi
}
}
// Z11a蓝图新增字段 → ALTER TABLE ADD COLUMN IF NOT EXISTS
inspectDB := appDB
if inspectDB == nil {
inspectDB = l.svcCtx.DB
}
if inspectDB != nil {
alter, err := schema.BuildPostgresAlterDDL(l.ctx, inspectDB, bp)
if err != nil {
rec.Status = meta.StatusFailed
rec.Error = err.Error()
_ = l.svcCtx.Meta.Save(l.ctx, rec)
return nil, fmt.Errorf("build alter ddl: %w", err)
}
if len(alter) > 0 {
ddl = schema.MergeDDL(ddl, alter)
rec.DDL = ddl
_ = l.svcCtx.Meta.Save(l.ctx, rec)
}
}
if err := runner.ExecDDL(l.ctx, ddl); err != nil {
rec.Status = meta.StatusFailed
rec.Error = err.Error()