SQLite: Implement migrations SQL generator

(I'm looking for feedback on a few of the TODOs.)
This is just a heuristic. Users could add drop/rename operations in between.