fixing db upgrades and setup