Fix default tag not working in embedded schema (#3451)

This commit is contained in:
rocinantex 2020-09-11 11:07:39 +08:00
parent 70a7bd52ca
commit 2a9062dd26

View File

@ -356,9 +356,7 @@ func (schema *Schema) ParseField(fieldStruct reflect.StructField) *Field {
ef.AutoIncrement = false
}
if ef.DefaultValue == "" {
ef.HasDefaultValue = false
}
_, ef.HasDefaultValue = ef.TagSettings["DEFAULT"]
}
for k, v := range field.TagSettings {