"feat: Refactor database connection in app.py and myp.db-shm"
This commit is contained in:
parent
534c4e7f1b
commit
f788f679cb
@ -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.
Loading…
x
Reference in New Issue
Block a user