Merge d0d746c6b5247093b8c83b4feee133c5aaaf3427 into 9acaa33324bbcc78239a1c913d4f1292c12177b9
This commit is contained in:
commit
ee95342b24
@ -542,8 +542,15 @@ func (scope *Scope) GetModelStruct() *ModelStruct {
|
||||
if value, ok := field.TagSettings["COLUMN"]; ok {
|
||||
field.DBName = value
|
||||
} else {
|
||||
|
||||
tag := field.Tag.Get("gorm")
|
||||
|
||||
if len(tag) > 0 && strings.HasPrefix(tag, "cloumn:") {
|
||||
field.DBName = strings.Replace(tag, "cloumn:", "", -1)
|
||||
} else {
|
||||
field.DBName = ToDBName(fieldStruct.Name)
|
||||
}
|
||||
}
|
||||
|
||||
modelStruct.StructFields = append(modelStruct.StructFields, field)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user