forked from mirror/gorm
Fix return incorrect sql type
This commit is contained in:
parent
61d2ccb764
commit
1e6e785651
|
@ -396,7 +396,7 @@ func (scope *Scope) sqlTagForField(field *Field) (typ string) {
|
||||||
switch reflectValue.Kind() {
|
switch reflectValue.Kind() {
|
||||||
case reflect.Slice:
|
case reflect.Slice:
|
||||||
if _, ok := value.([]byte); !ok {
|
if _, ok := value.([]byte); !ok {
|
||||||
return
|
return typ + " " + additionalType
|
||||||
}
|
}
|
||||||
case reflect.Struct:
|
case reflect.Struct:
|
||||||
if field.IsScanner() {
|
if field.IsScanner() {
|
||||||
|
@ -409,7 +409,7 @@ func (scope *Scope) sqlTagForField(field *Field) (typ string) {
|
||||||
}
|
}
|
||||||
getScannerValue(reflectValue.Field(0))
|
getScannerValue(reflectValue.Field(0))
|
||||||
} else if !field.IsTime() {
|
} else if !field.IsTime() {
|
||||||
return
|
return typ + " " + additionalType
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -421,10 +421,7 @@ func (scope *Scope) sqlTagForField(field *Field) (typ string) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(additionalType) > 0 {
|
return typ + " " + additionalType
|
||||||
typ = typ + " " + additionalType
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (scope *Scope) row() *sql.Row {
|
func (scope *Scope) row() *sql.Row {
|
||||||
|
|
Loading…
Reference in New Issue