This got me hoping for an sqlite where adding foreign keys didn’t require making a whole new table.
This sounds terrifyingly dangerous, so you should absolutely take a backup first - but I've found it to work just fine in practice.
Here's where I implement that in my sqlite-utils Python library and CLI tool:
https://github.com/simonw/sqlite-utils/blob/2d84577202e22767...
cp db.sqlite3 backup.sqlite3
echo .dump tablename |sqlite3 db.sqlite3 >old.sql
vi old.sql # make changes, ensure pragma FOREIGN_KEYS=off; drop table before insert
sqlite3 db.sqlite3 <old.sql