Skip to content

Commit

Permalink
feat: check if NamingStrategy is nil
Browse files Browse the repository at this point in the history
  • Loading branch information
tr1v3r committed Apr 13, 2022
1 parent 61f3ee2 commit d5a77f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/check/gen_structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func GenBaseStructs(db *gorm.DB, conf model.Conf) (bases *BaseStruct, err error)
if ns, ok := db.NamingStrategy.(schema.NamingStrategy); ok {
ns.SingularTable = true
m.Name = ns.SchemaName(ns.TablePrefix + m.Name)
} else {
} else if db.NamingStrategy != nil {
m.Name = db.NamingStrategy.SchemaName(m.Name)
}

Expand Down

0 comments on commit d5a77f5

Please sign in to comment.