Don't set primary key's HasDefaultValue to true (#2127)
This commit is contained in:
parent
f301f86e29
commit
cf9b85ed90
@ -202,7 +202,7 @@ func (scope *Scope) GetModelStruct() *ModelStruct {
|
|||||||
modelStruct.PrimaryFields = append(modelStruct.PrimaryFields, field)
|
modelStruct.PrimaryFields = append(modelStruct.PrimaryFields, field)
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, ok := field.TagSettingsGet("DEFAULT"); ok {
|
if _, ok := field.TagSettingsGet("DEFAULT"); ok && !field.IsPrimaryKey {
|
||||||
field.HasDefaultValue = true
|
field.HasDefaultValue = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user