From ba0febf308ecce0b0f8e479bf9b9ea55b982e2ac Mon Sep 17 00:00:00 2001 From: anlynn Date: Sun, 13 Jul 2025 10:40:16 +0800 Subject: [PATCH] fix: Fix PostgreSQL numeric type mapping in goctl model generation (#4992) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 李安琳 --- tools/goctl/config/default.yaml | 3 +++ tools/goctl/model/sql/model/postgresqlmodel.go | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/goctl/config/default.yaml b/tools/goctl/config/default.yaml index 6da7fa6b5..b61c62570 100644 --- a/tools/goctl/config/default.yaml +++ b/tools/goctl/config/default.yaml @@ -10,6 +10,9 @@ model: decimal: null_type: sql.NullFloat64 type: float64 + numeric: + null_type: sql.NullFloat64 + type: float64 double: null_type: sql.NullFloat64 type: float64 diff --git a/tools/goctl/model/sql/model/postgresqlmodel.go b/tools/goctl/model/sql/model/postgresqlmodel.go index 28c74f5a3..e80855f2a 100644 --- a/tools/goctl/model/sql/model/postgresqlmodel.go +++ b/tools/goctl/model/sql/model/postgresqlmodel.go @@ -9,8 +9,6 @@ import ( var p2m = map[string]string{ "int8": "bigint", - "numeric": "double", - "decimal": "double", "float8": "double", "float4": "float", "int2": "smallint",