fix singularize table names
This commit is contained in:
parent
3020468afb
commit
e85cc0b8ca
5
rest.go
5
rest.go
|
@ -506,9 +506,10 @@ func AutoMigrate(ctx context.Context, model any, cbs ...Option) (modelValue *Mod
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
//路由模块处理
|
//路由模块处理
|
||||||
|
singularizeTable := inflector.Singularize(table)
|
||||||
modelValue = newModel(model, opts.db, types.Naming{
|
modelValue = newModel(model, opts.db, types.Naming{
|
||||||
Pluralize: inflector.Pluralize(table),
|
Pluralize: inflector.Pluralize(singularizeTable),
|
||||||
Singular: inflector.Singularize(table),
|
Singular: singularizeTable,
|
||||||
ModuleName: opts.moduleName,
|
ModuleName: opts.moduleName,
|
||||||
TableName: table,
|
TableName: table,
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue