Do... you not turn the foreign key constraints off during migration?

In SQLite it's a pragma, in Postgres you turn triggers off, those are the ones I've personally done but surely any relational database has this ability for this specific reason?

best to use tools for this such as https://github.com/fabianlindfors/reshape or gh-ost for mysql