fix: coredump: goctl model mysql ddl --src user_base.sql --dir . area… (#3777)

Co-authored-by: Kevin Wan <wanjunfeng@gmail.com>
master
zzZZzzz888 11 months ago committed by GitHub
parent daef970091
commit 4835e4fe51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -8,7 +8,6 @@ import (
"github.com/zeromicro/ddl-parser/parser" "github.com/zeromicro/ddl-parser/parser"
"github.com/zeromicro/go-zero/core/collection" "github.com/zeromicro/go-zero/core/collection"
"github.com/zeromicro/go-zero/tools/goctl/model/sql/converter" "github.com/zeromicro/go-zero/tools/goctl/model/sql/converter"
"github.com/zeromicro/go-zero/tools/goctl/model/sql/model" "github.com/zeromicro/go-zero/tools/goctl/model/sql/model"
"github.com/zeromicro/go-zero/tools/goctl/model/sql/util" "github.com/zeromicro/go-zero/tools/goctl/model/sql/util"
@ -145,11 +144,7 @@ func Parse(filename, database string, strict bool) ([]*Table, error) {
} }
} }
var ( uniqueIndex := make(map[string][]*Field)
uniqueIndex = make(map[string][]*Field)
// Unused local variable
// normalIndex = make(map[string][]*Field)
)
for indexName, each := range uniqueKeyMap { for indexName, each := range uniqueKeyMap {
for _, columnName := range each { for _, columnName := range each {
@ -161,13 +156,6 @@ func Parse(filename, database string, strict bool) ([]*Table, error) {
} }
} }
// Unused local variable
// for indexName, each := range normalKeyMap {
// for _, columnName := range each {
// normalIndex[indexName] = append(normalIndex[indexName], fieldM[columnName])
// }
// }
checkDuplicateUniqueIndex(uniqueIndex, e.Name) checkDuplicateUniqueIndex(uniqueIndex, e.Name)
list = append(list, &Table{ list = append(list, &Table{

Loading…
Cancel
Save