Improving database upgrade