better database upgrade