Skip to content

Commit

Permalink
fix: automatically set nullzero when there is default:value option
Browse files Browse the repository at this point in the history
  • Loading branch information
vmihailenco committed Apr 20, 2022
1 parent 289cc63 commit 72c44ae
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions schema/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ func (t *Table) newField(f reflect.StructField, prefix string, index []int) *Fie
}
if s, ok := tag.Option("default"); ok {
field.SQLDefault = s
field.NullZero = true
}
if s, ok := field.Tag.Option("type"); ok {
field.UserSQLType = s
Expand Down

0 comments on commit 72c44ae

Please sign in to comment.