Implemented database upgrade