Skip to content

Commit

Permalink
fix bug for tinyint(8) unsigned
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bingbingtea authored Sep 22, 2020
1 parent aa43435 commit 75475df
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion data/view/cnf/def.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,15 @@ var TypeMysqlDicMp = map[string]string{
"longblob": "[]byte",
}

// TypeMysqlMatchMp Fuzzy Matching Types.模糊匹配类型

// TypeMysqlMatchMp Fuzzy Matching Types.模糊匹配类型
var TypeMysqlMatchMp = map[string]string{
`^(tinyint)[(]\d+[)]`: "int8",
`^(tinyint)[(]\d+[)] unsigned`: "uint8",
`^(smallint)[(]\d+[)] unsigned`: "uint16",
`^(int)[(]\d+[)] unsigned`: "uint32",
`^(bigint)[(]\d+[)] unsigned`: "uint64",
`^(tinyint)[(]\d+[)]`: "int8",
`^(smallint)[(]\d+[)]`: "int16",
`^(int)[(]\d+[)]`: "int",
`^(bigint)[(]\d+[)]`: "int64",
Expand Down

0 comments on commit 75475df

Please sign in to comment.