From 05020a92e817c9c4356dbc5ef7e30b1b275f9789 Mon Sep 17 00:00:00 2001 From: guangwu Date: Mon, 11 Dec 2023 23:13:35 +0800 Subject: [PATCH] fix: primary key unique key simultaneously exist cacheIdPrefix duplicate (#3763) Signed-off-by: guoguangwu --- tools/goctl/model/sql/parser/parser.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/goctl/model/sql/parser/parser.go b/tools/goctl/model/sql/parser/parser.go index fbd9a758..90486784 100644 --- a/tools/goctl/model/sql/parser/parser.go +++ b/tools/goctl/model/sql/parser/parser.go @@ -128,6 +128,8 @@ func Parse(filename, database string, strict bool) ([]*Table, error) { return nil, fmt.Errorf("%s: unexpected join primary key", prefix) } + delete(uniqueKeyMap, indexNameGen(primaryColumn, "idx")) + delete(uniqueKeyMap, indexNameGen(primaryColumn, "unique")) primaryKey, fieldM, err := convertColumns(columns, primaryColumn, strict) if err != nil { return nil, err