Before control chart update.

This commit is contained in:
lwark
2024-07-31 07:50:23 -05:00
parent 2a07265cbc
commit eb6cdc63e2
10 changed files with 305 additions and 396 deletions

View File

@@ -3,6 +3,7 @@ All database related operations.
"""
from sqlalchemy import event
from sqlalchemy.engine import Engine
from tools import ctx
@event.listens_for(Engine, "connect")
@@ -17,7 +18,8 @@ def set_sqlite_pragma(dbapi_connection, connection_record):
connection_record (_type_): _description_
"""
cursor = dbapi_connection.cursor()
# cursor.execute("PRAGMA foreign_keys=ON")
if ctx.database_schema == "sqlite":
cursor.execute("PRAGMA foreign_keys=ON")
cursor.close()