From 86a2845fa5102b901b21879648bb7732808b8ec4 Mon Sep 17 00:00:00 2001 From: Albelt Date: Tue, 29 Oct 2024 11:54:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=97=E6=AE=B5=E5=90=8D=E7=A7=B0=E8=BD=AC?= =?UTF-8?q?=E6=8D=A2=E8=AF=AF=E7=94=A8SchemaName,=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E4=B8=BAColumnName?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/generate/generate.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/generate/generate.go b/internal/generate/generate.go index b2b23df3..3bcad67a 100644 --- a/internal/generate/generate.go +++ b/internal/generate/generate.go @@ -33,9 +33,9 @@ func getFields(db *gorm.DB, conf *model.Config, columns []*model.Column) (fields m = modifyField(m, conf.ModifyOpts) if ns, ok := db.NamingStrategy.(schema.NamingStrategy); ok { ns.SingularTable = true - m.Name = ns.SchemaName(ns.TablePrefix + m.Name) + m.Name = ns.ColumnName("", m.Name) } else if db.NamingStrategy != nil { - m.Name = db.NamingStrategy.SchemaName(m.Name) + m.Name = db.NamingStrategy.ColumnName("", m.Name) } fields = append(fields, m)