fix: coredump: goctl model mysql ddl --src user_base.sql --dir . area… (#3777)
Co-authored-by: Kevin Wan <wanjunfeng@gmail.com>
This commit is contained in:
@@ -8,7 +8,6 @@ import (
|
||||
|
||||
"github.com/zeromicro/ddl-parser/parser"
|
||||
"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/model"
|
||||
"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)
|
||||
// Unused local variable
|
||||
// normalIndex = make(map[string][]*Field)
|
||||
)
|
||||
uniqueIndex := make(map[string][]*Field)
|
||||
|
||||
for indexName, each := range uniqueKeyMap {
|
||||
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)
|
||||
|
||||
list = append(list, &Table{
|
||||
|
||||
Reference in New Issue
Block a user