From c1175e4961de0f7f67c022eee5878f913a639d4e Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Mon, 3 Jul 2023 08:46:01 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20chore(base.py):=20remove=20unnec?= =?UTF-8?q?essary=20debug=20log=20and=20add=20success=20log=20for=20databa?= =?UTF-8?q?se=20and=20tables=20creation=20The=20debug=20log=20statement=20?= =?UTF-8?q?"Database=20and=20tables=20created"=20has=20been=20removed=20as?= =?UTF-8?q?=20it=20is=20unnecessary.=20Instead,=20a=20success=20log=20stat?= =?UTF-8?q?ement=20"Database=20and=20tables=20created=20successfully"=20ha?= =?UTF-8?q?s=20been=20added=20to=20indicate=20that=20the=20database=20and?= =?UTF-8?q?=20tables=20were=20created=20without=20any=20errors.=20This=20i?= =?UTF-8?q?mproves=20the=20clarity=20of=20the=20log=20messages=20and=20pro?= =?UTF-8?q?vides=20better=20feedback=20during=20the=20database=20setup=20p?= =?UTF-8?q?rocess.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/langflow/database/base.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/backend/langflow/database/base.py b/src/backend/langflow/database/base.py index 37fe00255..add28192a 100644 --- a/src/backend/langflow/database/base.py +++ b/src/backend/langflow/database/base.py @@ -13,7 +13,6 @@ engine = create_engine(settings.database_url, connect_args=connect_args) def create_db_and_tables(): logger.debug("Creating database and tables") SQLModel.metadata.create_all(engine) - logger.debug("Database and tables created") # Now check if the table Flow exists, if not, something went wrong # and we need to create the tables again. from sqlalchemy import inspect @@ -23,6 +22,8 @@ def create_db_and_tables(): logger.error("Something went wrong creating the database and tables.") logger.error("Please check your database settings.") raise RuntimeError("Something went wrong creating the database and tables.") + else: + logger.debug("Database and tables created successfully") def get_session():