"It is not possible to enable or disable foreign key constraints in the middle of a multi-statement transaction (when SQLite is not in autocommit mode. Attempting to do so does not return an error; it simply has no effect."
This simply moves the call outside the transaction and adds it to the down section as well
From https://www.sqlite.org/foreignkeys.html - last paragraph of section 2
"It is not possible to enable or disable foreign key constraints in the middle of a multi-statement transaction (when SQLite is not in autocommit mode. Attempting to do so does not return an error; it simply has no effect."
This simply moves the call outside the transaction and adds it to the down section as well