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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user