diff --git a/model_struct.go b/model_struct.go index bfab49c0..5234b287 100644 --- a/model_struct.go +++ b/model_struct.go @@ -202,7 +202,7 @@ func (scope *Scope) GetModelStruct() *ModelStruct { modelStruct.PrimaryFields = append(modelStruct.PrimaryFields, field) } - if _, ok := field.TagSettingsGet("DEFAULT"); ok { + if _, ok := field.TagSettingsGet("DEFAULT"); ok && !field.IsPrimaryKey { field.HasDefaultValue = true }