From 8137dd1388e3587df069869c571aaf4491b33851 Mon Sep 17 00:00:00 2001 From: Nikitin Aleksandr Date: Thu, 28 Nov 2024 17:52:26 +0300 Subject: [PATCH] =?UTF-8?q?=D1=81=D0=B4=D0=B5=D0=BB=D0=B0=D0=BB=20MassOmit?= =?UTF-8?q?=20string?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../create_files/crud_tables/crud_tables_crud.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/internal/create_files/crud_tables/crud_tables_crud.go b/internal/create_files/crud_tables/crud_tables_crud.go index dfef839..97297af 100644 --- a/internal/create_files/crud_tables/crud_tables_crud.go +++ b/internal/create_files/crud_tables/crud_tables_crud.go @@ -291,6 +291,20 @@ func AddTextOmit(TextDB string, Table1 *types.Table) string { MassOmit = append(MassOmit, ColumnName) } +` + } else if TypeGo == "string" && (Column1.TableKey != "" || is_nullable_config == true) { + NullableCount = NullableCount + 1 + TextFind := `if m.` + ColumnNameGo + ` == "" {` + pos1 := strings.Index(TextDB, TextFind) + if pos1 >= 0 { + continue + } + + TextOmit = TextOmit + "\t" + `ColumnName = "` + ColumnNameGo + `" + if m.` + ColumnNameGo + ` == "" { + MassOmit = append(MassOmit, ColumnName) + } + ` }