M5: enable SQLite foreign_keys pragma for DB-level FK enforcement

This commit is contained in:
2026-06-22 20:45:47 +02:00
parent 489cd7df3d
commit 6090b98ab0
2 changed files with 60 additions and 0 deletions
+1
View File
@@ -28,6 +28,7 @@ def _get_engine(database_url: str) -> Engine:
def _enable_sqlite_wal(dbapi_connection, _connection_record):
cursor = dbapi_connection.cursor()
cursor.execute("PRAGMA journal_mode=WAL")
cursor.execute("PRAGMA foreign_keys=ON")
cursor.close()
return engine