- Trying to solve database initialisation problem (no tables in tenant schema).

This commit is contained in:
Josako
2025-09-05 11:11:08 +02:00
parent 6115cc7e13
commit a6edd5c663
7 changed files with 32 additions and 13 deletions

View File

@@ -46,7 +46,10 @@ class Database:
def create_tables(self):
"""create tables in for schema"""
db.metadata.create_all(self.get_engine())
try:
db.metadata.create_all(self.get_engine())
except SQLAlchemyError as e:
current_app.logger.error(f"💔 Error creating tables for schema {self.schema}: {e.args}")
def switch_schema(self):
"""switch between tenant/public database schema"""