Optimize model nl (#686)
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"sort"
|
||||
|
||||
"github.com/tal-tech/go-zero/core/stores/sqlx"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/model/sql/util"
|
||||
)
|
||||
|
||||
const indexPri = "PRIMARY"
|
||||
@@ -151,6 +152,7 @@ func (c *ColumnData) Convert() (*Table, error) {
|
||||
|
||||
m := make(map[string][]*Column)
|
||||
for _, each := range c.Columns {
|
||||
each.Comment = util.TrimNewLine(each.Comment)
|
||||
if each.Index != nil {
|
||||
m[each.Index.IndexName] = append(m[each.Index.IndexName], each)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user