Ask sqlite to check foreign keys
authorJulien Cristau <julien.cristau@logilab.fr>
Thu, 15 Jan 2015 19:17:32 +0100
changeset 10205 737271ffe407
parent 10204 f8ccae1e271d
child 10206 0ecd61f4bd37
Ask sqlite to check foreign keys Related to #4846892
server/sqlutils.py
--- a/server/sqlutils.py	Thu Jan 15 18:53:45 2015 +0100
+++ b/server/sqlutils.py	Thu Jan 15 19:17:32 2015 +0100
@@ -500,6 +500,8 @@
         return (dt.weekday() + 1) % 7
     cnx.create_function("WEEKDAY", 1, weekday)
 
+    cnx.cursor().execute("pragma foreign_keys = on")
+
     import yams.constraints
     yams.constraints.patch_sqlite_decimal()