测试
This commit is contained in:
parent
90871c1ab0
commit
363bd12575
|
@ -127,7 +127,13 @@ func GenFromPath(mdir string, cols []Column, tableName string, tableComment stri
|
|||
typeName := typeForMysqlToGo[col.GetType()]
|
||||
var defaultString string
|
||||
if col.DefaultValue != nil {
|
||||
defaultString = "default:" + *col.DefaultValue + ";"
|
||||
switch typeName {
|
||||
case "*int64", "*uint64", "*float64", "*bool":
|
||||
defaultString = "default:" + strings.Trim(*col.DefaultValue, "'") + ";"
|
||||
default:
|
||||
defaultString = "default:" + *col.DefaultValue + ";"
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
switch typeName {
|
||||
|
@ -138,11 +144,11 @@ func GenFromPath(mdir string, cols []Column, tableName string, tableComment stri
|
|||
case "*[]byte":
|
||||
defaultString = "default:'';"
|
||||
case "*int64", "*uint64":
|
||||
defaultString = "default:'0';"
|
||||
defaultString = "default:0;"
|
||||
case "*float64":
|
||||
defaultString = "default:'0.0';"
|
||||
defaultString = "default: 0.0;"
|
||||
case "*bool":
|
||||
defaultString = "default:'0';"
|
||||
defaultString = "default:0;"
|
||||
default:
|
||||
fieldName = "// " + fieldName + " " + col.Type
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user