diff --git a/etc/ppanel.yaml b/etc/ppanel.yaml index 8df77b4..15098be 100644 --- a/etc/ppanel.yaml +++ b/etc/ppanel.yaml @@ -15,9 +15,9 @@ Logger: # 日志配置 Level: debug # 日志级别: debug, info, warn, error, panic, fatal MySQL: - Addr: 127.0.0.1:3306 # host 网络模式; bridge 模式改为 mysql:3306 + Addr: 154.12.35.103:3306 # host 网络模式; bridge 模式改为 mysql:3306 Username: root # MySQL用户名 - Password: CHANGE_ME_MYSQL_PASSWORD # MySQL密码,与 .env MYSQL_ROOT_PASSWORD 一致 + Password: jpcV41ppanel # MySQL密码,与 .env MYSQL_ROOT_PASSWORD 一致 Dbname: ppanel # MySQL数据库名 Config: charset=utf8mb4&parseTime=true&loc=Asia%2FShanghai MaxIdleConns: 10 diff --git a/initialize/schema_compat.go b/initialize/schema_compat.go index 329b0d1..10bf38d 100644 --- a/initialize/schema_compat.go +++ b/initialize/schema_compat.go @@ -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)