Fix database upgrade
Add type to settings (untested)