mbucc / shmig

Database migration tool written in BASH.
BSD 3-Clause "New" or "Revised" License
461 stars 50 forks source link

Fix foreign_keys for sqlite #69

Closed wishdev closed 3 weeks ago

wishdev commented 11 months ago

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