From 9c70a3fe20b7e1dbb41453a5d24a6408121660d4 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Tue, 3 Oct 2023 18:13:41 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(manager.py):=20add=20inspect?= =?UTF-8?q?or=20to=20check=20if=20table=20"flow"=20exists=20before=20creat?= =?UTF-8?q?ing=20tables=20again?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The change was made to fix a bug where the tables were being recreated even if they already existed. By adding an inspector to check if the table "flow" exists before recreating the tables, we can prevent unnecessary table creation and improve performance. --- src/backend/langflow/services/database/manager.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/backend/langflow/services/database/manager.py b/src/backend/langflow/services/database/manager.py index 18364cd62..4cb715323 100644 --- a/src/backend/langflow/services/database/manager.py +++ b/src/backend/langflow/services/database/manager.py @@ -171,6 +171,7 @@ class DatabaseService(Service): # Now check if the table "flow" exists, if not, something went wrong # and we need to create the tables again. + inspector = inspect(self.engine) table_names = inspector.get_table_names() for table in current_tables: if table not in table_names: