SQLite: Implement migrations SQL generator

(I'm looking for feedback on a few of the TODOs.)
There seems to be two commonly used standards. This one, and one like it without the `ON` clause.