1
0
mirror of https://github.com/beego/bee.git synced 2024-11-21 18:40:54 +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
commit 958e4564d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -925,9 +925,9 @@ func extractColSize(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)
return strings.Trim(signRegex[2], " ")
return strings.Trim(signRegex[1], " ")
}
func extractDecimal(colType string) (digits string, decimals string) {