Don't set auto increment primary key's HasDefaultValue to true
This commit is contained in:
parent
294eb58fc2
commit
8f0f5df8c6
@ -175,7 +175,7 @@ func (scope *Scope) GetModelStruct() *ModelStruct {
|
|||||||
field.HasDefaultValue = true
|
field.HasDefaultValue = true
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, ok := field.TagSettings["AUTO_INCREMENT"]; ok {
|
if _, ok := field.TagSettings["AUTO_INCREMENT"]; ok && !field.IsPrimaryKey {
|
||||||
field.HasDefaultValue = true
|
field.HasDefaultValue = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user