Before control chart update.
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user