"feat: Refactor database connection in app.py and myp.db-shm"

This commit is contained in:
Till Tomczak 2025-05-29 18:48:17 +02:00
parent 534c4e7f1b
commit f788f679cb
2 changed files with 2 additions and 2 deletions

View File

@ -1673,7 +1673,7 @@ def api_admin_system_health():
# 1. Datenbank-Schema-Integrität prüfen
try:
# Test verschiedene kritische Tabellen und Spalten
db_session.execute("SELECT COUNT(*) FROM guest_requests WHERE duration_minutes IS NOT NULL")
db_session.execute(text("SELECT COUNT(*) FROM guest_requests WHERE duration_minutes IS NOT NULL"))
schema_integrity = "OK"
except Exception as e:
critical_errors.append({
@ -1697,7 +1697,7 @@ def api_admin_system_health():
missing_columns = []
for table, column in schema_checks:
try:
db_session.execute(f"SELECT {column} FROM {table} LIMIT 1")
db_session.execute(text(f"SELECT {column} FROM {table} LIMIT 1"))
except Exception:
missing_columns.append(f"{table}.{column}")

Binary file not shown.