Log upgrade events to a sqlite database file
WIP upgrade refactors