SQLite Migrations: Lift foreign key creation to CREATE TABLE statements

(I'm looking for feedback on a few of the TODOs.)
Initially, we're going to throw on cycles.