Skip to content

Commit

Permalink
fix: 代码自动生成选择业务库自动迁移代码生成异常
Browse files Browse the repository at this point in the history
  • Loading branch information
lbbniu committed Aug 12, 2024
1 parent 332a8de commit ca6e1ed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/utils/ast/package_initialize_gorm.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func (a *PackageInitializeGorm) addDbVar(astBody *ast.BlockStmt) {
for i := range astBody.List {
if assignStmt, ok := astBody.List[i].(*ast.AssignStmt); ok {
if ident, ok := assignStmt.Lhs[0].(*ast.Ident); ok {
if ident.Name == "db" || ident.Name == a.Business+"Db" {
if (a.Business == "" && ident.Name == "db") || ident.Name == a.Business+"Db" {
return
}
}
Expand Down

0 comments on commit ca6e1ed

Please sign in to comment.