diff --git a/model_struct.go b/model_struct.go index d8f9ed1b..d6a71c0b 100644 --- a/model_struct.go +++ b/model_struct.go @@ -175,7 +175,7 @@ func (scope *Scope) GetModelStruct() *ModelStruct { field.HasDefaultValue = true } - if _, ok := field.TagSettings["AUTO_INCREMENT"]; ok { + if _, ok := field.TagSettings["AUTO_INCREMENT"]; ok && !field.IsPrimaryKey { field.HasDefaultValue = true }