Merge branch 'master' into master
This commit is contained in:
commit
9ed1469547
@ -103,10 +103,10 @@ func (s *mysql) DataTypeOf(field *StructField) string {
|
|||||||
precision = fmt.Sprintf("(%s)", p)
|
precision = fmt.Sprintf("(%s)", p)
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, ok := field.TagSettingsGet("NOT NULL"); ok || field.IsPrimaryKey {
|
if _, ok := field.TagSettings["NOT NULL"]; ok || field.IsPrimaryKey {
|
||||||
sqlType = fmt.Sprintf("timestamp%v", precision)
|
sqlType = fmt.Sprintf("DATETIME%v", precision)
|
||||||
} else {
|
} else {
|
||||||
sqlType = fmt.Sprintf("timestamp%v NULL", precision)
|
sqlType = fmt.Sprintf("DATETIME%v NULL", precision)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
2
scope.go
2
scope.go
@ -225,7 +225,7 @@ func (scope *Scope) SetColumn(column interface{}, value interface{}) error {
|
|||||||
updateAttrs[field.DBName] = value
|
updateAttrs[field.DBName] = value
|
||||||
return field.Set(value)
|
return field.Set(value)
|
||||||
}
|
}
|
||||||
if (field.DBName == dbName) || (field.Name == name && mostMatchedField == nil) {
|
if !field.IsIgnored && ((field.DBName == dbName) || (field.Name == name && mostMatchedField == nil)) {
|
||||||
mostMatchedField = field
|
mostMatchedField = field
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user