You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
codegen.go only checks for strings.ToUpper(f.DefaultValue) == "CURRENT_TIMESTAMP" or strings.ToUpper(f.DefaultValue) == "NOW()"
when deciding whether a time column has some default value. See https://github.com/mijia/modelq/blob/master/main.go#L28
codegen.go only checks for
strings.ToUpper(f.DefaultValue) == "CURRENT_TIMESTAMP"
orstrings.ToUpper(f.DefaultValue) == "NOW()"
when deciding whether a time column has some default value. See https://github.com/mijia/modelq/blob/master/main.go#L28
However, MySql also allows default values like
CURRENT_TIMESTAMP(X)
andNOW(X)
where X is a number. See http://dev.mysql.com/doc/refman/5.7/en/timestamp-initialization.htmlI think code generator should check for matches against
^NOW(?:\\(\\d\\))?$"
and"^CURRENT_TIMESTAMP(?:\\(\\d\\))?$"
The text was updated successfully, but these errors were encountered: