when id(PrioritizedPrimaryField) datatype is bigint, AUTO_INCREMENT missed

This commit is contained in:
zhangdongdong92 2022-08-13 20:30:21 +08:00
parent a35883590b
commit 5e634f15df

View File

@ -229,7 +229,7 @@ func ParseWithSpecialTableName(dest interface{}, cacheStore *sync.Map, namer Nam
}
if field := schema.PrioritizedPrimaryField; field != nil {
switch field.GORMDataType {
switch field.DataType {
case Int, Uint:
if _, ok := field.TagSettings["AUTOINCREMENT"]; !ok {
if !field.HasDefaultValue || field.DefaultValueInterface != nil {