WIP: Sqlite migration support

Just need the PR id in another ticket. Maybe it's done in a few days.