SQLite: Implement migrations SQL generator

(I'm looking for feedback on a few of the TODOs.)
Be careful not to iterate IEnumerables multiple times.