1
0
mirror of https://github.com/beego/bee.git synced 2025-07-14 18:21:02 +00:00

Merge pull request #743 from 1920853199/develop

fix issues #730 bee generate appcode [index out of range [2] with length 0]
This commit is contained in:
Ming Deng
2020-12-03 23:54:21 +08:00
committed by GitHub

View File

@ -925,9 +925,9 @@ func extractColSize(colType string) string {
} }
func extractIntSignness(colType string) string { func extractIntSignness(colType string) string {
regex := regexp.MustCompile(`(int|smallint|mediumint|bigint)\([0-9]+\)(.*)`) regex := regexp.MustCompile(`(int|smallint|mediumint|bigint).*`)
signRegex := regex.FindStringSubmatch(colType) signRegex := regex.FindStringSubmatch(colType)
return strings.Trim(signRegex[2], " ") return strings.Trim(signRegex[1], " ")
} }
func extractDecimal(colType string) (digits string, decimals string) { func extractDecimal(colType string) (digits string, decimals string) {