Skip to content

Commit

Permalink
字段名称转换误用SchemaName,修正为ColumnName
Browse files Browse the repository at this point in the history
  • Loading branch information
Albelt committed Oct 29, 2024
1 parent 1c60357 commit 86a2845
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/generate/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ func getFields(db *gorm.DB, conf *model.Config, columns []*model.Column) (fields
m = modifyField(m, conf.ModifyOpts)
if ns, ok := db.NamingStrategy.(schema.NamingStrategy); ok {
ns.SingularTable = true
m.Name = ns.SchemaName(ns.TablePrefix + m.Name)
m.Name = ns.ColumnName("", m.Name)
} else if db.NamingStrategy != nil {
m.Name = db.NamingStrategy.SchemaName(m.Name)
m.Name = db.NamingStrategy.ColumnName("", m.Name)
}

fields = append(fields, m)
Expand Down

0 comments on commit 86a2845

Please sign in to comment.