Skip to content

Commit

Permalink
Merge pull request #515 from uptrace/fix/default-null-zero
Browse files Browse the repository at this point in the history
fix: automatically set nullzero when there is default:value option
  • Loading branch information
vmihailenco authored Apr 20, 2022
2 parents 289cc63 + 72c44ae commit 5b63742
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 5b63742

Please sign in to comment.