add different column name parse strategy

This commit is contained in:
nlimpid
2018-11-20 22:47:56 +08:00
parent e22a5143bc
commit 6b0155c4fb
5 changed files with 63 additions and 5 deletions

View File

@@ -109,7 +109,7 @@ func getTableUnique(val reflect.Value) [][]string {
func getColumnName(ft int, addrField reflect.Value, sf reflect.StructField, col string) string {
column := col
if col == "" {
column = snakeString(sf.Name)
column = nameStrategyMap[nameStrategy](sf.Name)
}
switch ft {
case RelForeignKey, RelOneToOne: