Skip to content

Commit

Permalink
[plat-908] Add default to generated model
Browse files Browse the repository at this point in the history
Add default to generated model regardless it's a function or not
  • Loading branch information
xingjianan authored Dec 14, 2021
2 parents 06cf3ad + 88a7ecf commit f584c55
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion dbmeta/meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ func createGormAnnotation(c ColumnMeta) string {
value = ""
}

if value != "" && !strings.Contains(value, "()") {
if value != "" {
buf.WriteString(fmt.Sprintf("default:%s;", value))
}
}
Expand Down
28 changes: 14 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,36 @@ module github.com/cresta/smallnest-gen
go 1.17

require (
github.com/bxcodec/faker/v3 v3.5.0
github.com/bxcodec/faker/v3 v3.6.0
github.com/davecgh/go-spew v1.1.1
github.com/denisenkom/go-mssqldb v0.9.0
github.com/denisenkom/go-mssqldb v0.11.0
github.com/droundy/goopt v0.0.0-20170604162106-0b8effe182da
github.com/gobuffalo/packd v1.0.0
github.com/gobuffalo/packr/v2 v2.8.1
github.com/iancoleman/strcase v0.1.2
github.com/gobuffalo/packd v1.0.1
github.com/gobuffalo/packr/v2 v2.8.3
github.com/iancoleman/strcase v0.2.0
github.com/jimsmart/schema v0.2.0
github.com/jinzhu/gorm v1.9.16
github.com/jinzhu/inflection v1.0.0
github.com/lib/pq v1.10.0
github.com/lib/pq v1.10.4
github.com/logrusorgru/aurora v2.0.3+incompatible
github.com/mattn/go-sqlite3 v2.0.3+incompatible
github.com/ompluscator/dynamic-struct v1.3.0
github.com/serenize/snaker v0.0.0-20171204205717-a683aaf2d516
golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e
github.com/serenize/snaker v0.0.0-20201027110005-a7ad2135616e
golang.org/x/tools v0.1.7
)

require (
github.com/go-sql-driver/mysql v1.6.0 // indirect
github.com/gobuffalo/logger v1.0.3 // indirect
github.com/gobuffalo/logger v1.0.6 // indirect
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe // indirect
github.com/karrick/godirwalk v1.16.1 // indirect
github.com/markbates/errx v1.1.0 // indirect
github.com/markbates/oncer v1.0.0 // indirect
github.com/markbates/safe v1.0.1 // indirect
github.com/rogpeppe/go-internal v1.6.2 // indirect
github.com/sirupsen/logrus v1.7.0 // indirect
golang.org/x/crypto v0.0.0-20201012173705-84dcc777aaee // indirect
golang.org/x/mod v0.3.0 // indirect
golang.org/x/sys v0.0.0-20210112080510-489259a85091 // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
golang.org/x/crypto v0.0.0-20211209193657-4570a0811e8b // indirect
golang.org/x/mod v0.4.2 // indirect
golang.org/x/sys v0.0.0-20211213223007-03aa0b5f6827 // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
)

0 comments on commit f584c55

Please sign in to comment.