fix bug for tinyint(8) unsigned

When I used this tool to generate files, I found that even if the table structure did not change, the generated files would change. After debugging. Finding the configuration here will cause the program to find two keys randomly. The original code might have tinyint (8) unsigned randomly match int8 or Unit8. Put the unsigned one to the front, and then test it. This problem will not happen again.
This commit is contained in:
lubin
2020-09-22 12:01:31 +08:00
committed by GitHub
parent aa434356e0
commit 75475dfa6f

View File

@@ -42,10 +42,15 @@ var TypeMysqlDicMp = map[string]string{
"longblob": "[]byte", "longblob": "[]byte",
} }
// TypeMysqlMatchMp Fuzzy Matching Types.模糊匹配类型
// TypeMysqlMatchMp Fuzzy Matching Types.模糊匹配类型 // TypeMysqlMatchMp Fuzzy Matching Types.模糊匹配类型
var TypeMysqlMatchMp = map[string]string{ var TypeMysqlMatchMp = map[string]string{
`^(tinyint)[(]\d+[)]`: "int8",
`^(tinyint)[(]\d+[)] unsigned`: "uint8", `^(tinyint)[(]\d+[)] unsigned`: "uint8",
`^(smallint)[(]\d+[)] unsigned`: "uint16",
`^(int)[(]\d+[)] unsigned`: "uint32",
`^(bigint)[(]\d+[)] unsigned`: "uint64",
`^(tinyint)[(]\d+[)]`: "int8",
`^(smallint)[(]\d+[)]`: "int16", `^(smallint)[(]\d+[)]`: "int16",
`^(int)[(]\d+[)]`: "int", `^(int)[(]\d+[)]`: "int",
`^(bigint)[(]\d+[)]`: "int64", `^(bigint)[(]\d+[)]`: "int64",