From a3e7fe06a6608d6f34f2ee90e439a4b2e5796017 Mon Sep 17 00:00:00 2001 From: Nikitin Aleksandr Date: Wed, 17 Jan 2024 10:41:15 +0300 Subject: [PATCH] =?UTF-8?q?=D1=81=D0=B4=D0=B5=D0=BB=D0=B0=D0=BB=20NEED=5FC?= =?UTF-8?q?REATE=5FDB=5FTABLES?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/config/config.go | 4 ++++ internal/create_files/db_tables/db_tables.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/config/config.go b/internal/config/config.go index 50fadad..052d3be 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -36,6 +36,7 @@ type SettingsINI struct { NEED_CREATE_MODEL_CRUD bool NEED_CREATE_DB bool NEED_CREATE_DB_TEST bool + NEED_CREATE_DB_TABLES bool NEED_CREATE_GRPC bool NEED_CREATE_GRPC_SERVER_TEST bool NEED_CREATE_GRPC_CLIENT_TEST bool @@ -94,6 +95,9 @@ func FillSettings() { sNEED_CREATE_DB := os.Getenv("NEED_CREATE_DB") Settings.NEED_CREATE_DB = BoolFromString(sNEED_CREATE_DB) + sNEED_CREATE_DB_TABLES := os.Getenv("NEED_CREATE_DB_TABLES") + Settings.NEED_CREATE_DB_TABLES = BoolFromString(sNEED_CREATE_DB_TABLES) + sNEED_GRPC := os.Getenv("NEED_CREATE_GRPC") Settings.NEED_CREATE_GRPC = BoolFromString(sNEED_GRPC) diff --git a/internal/create_files/db_tables/db_tables.go b/internal/create_files/db_tables/db_tables.go index adcb7a1..6633fae 100644 --- a/internal/create_files/db_tables/db_tables.go +++ b/internal/create_files/db_tables/db_tables.go @@ -46,7 +46,7 @@ func CreateFiles(Table1 *types.Table) error { folders.CreateFolder(DirReadyTable) // создание файла struct - if config.Settings.NEED_CREATE_DB == true { + if config.Settings.NEED_CREATE_DB_TABLES == true { err = CreateFilesTable_struct(Table1, DirTemplatesTable, DirReadyTable) if err != nil { log.Error("CreateFilesTable_struct() table: ", Table1.Name, " error: ", err)