🐛 fix(manager.py): add inspector to check if table "flow" exists before creating tables again

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.
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-10-03 18:13:41 -03:00
commit 9c70a3fe20

View file

@ -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: