Don't set primary key's HasDefaultValue to true
This commit is contained in:
parent
742154be9a
commit
85ba776e65
@ -189,7 +189,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