Skip to content

Commit

Permalink
Merge pull request #5 from go-gorm/fix_default
Browse files Browse the repository at this point in the history
feat: default value nil
  • Loading branch information
qqxhb authored Sep 5, 2023
2 parents f0aad24 + bb0dd9d commit af94405
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions table.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,8 @@ func (*defaultParser) getColumnType(col *ast.ColumnDef) gorm.ColumnType {
if opt.Tp == ast.ColumnOptionDefaultValue {
if v, ok := opt.Expr.(*test_driver.ValueExpr); ok {
ct.DefaultValueValue = sql.NullString{
Valid: true, String: fmt.Sprint(v.Datum.GetValue()),
Valid: v.Datum.GetValue() != nil, String: fmt.Sprint(v.Datum.GetValue()),
}

continue
}

Expand Down

0 comments on commit af94405

Please sign in to comment.