Skip to content

Commit

Permalink
Stabilize schema.FieldsWithDefaultDBValue's order, close go-gorm#4643
Browse files Browse the repository at this point in the history
  • Loading branch information
jinzhu committed Nov 8, 2021
1 parent ca7accd commit 5daa413
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion schema/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ func ParseWithSpecialTableName(dest interface{}, cacheStore *sync.Map, namer Nam
schema.PrimaryFieldDBNames = append(schema.PrimaryFieldDBNames, field.DBName)
}

for _, field := range schema.FieldsByDBName {
for _, field := range schema.Fields {
if field.HasDefaultValue && field.DefaultValueInterface == nil {
schema.FieldsWithDefaultDBValue = append(schema.FieldsWithDefaultDBValue, field)
}
Expand Down

0 comments on commit 5daa413

Please sign in to comment.