SQLite backend contain "PRAGMA foreign_key_check=OFF/ON" which ins't correct SQLite syntax. Author intention was probably disengage key checking. In SQLlite this can be achieved be temporary deffer key check. Correct syntax is in this case "PRAGMA defer_foreign_keys=ON/OFF". This partial resolves bug 402229.
CCBUG: 402229