The second comment says: https://github.com/launchbadge/sqlx/issues/2085#issuecomment-1237474188 >
The second comment says: https://github.com/launchbadge/sqlx/issues/2085#issuecomment-1237474188
follow up: it seems like bracketing it with PRAGMA defer_foreign_keys = ON; and PRAGMA defer_foreign_keys = OFF; does make it work. I am not familiar enough with arcane SQLite stuff to give a super informed view on whether this should be automatically applied to every migration, but I suspect it might be a good idea - my understanding is that the foreign key constraints will still be checked, but just at the time that the transaction is committed.


