Fix database upgrades from partially initialized schema 1 databases