updated database upgrade method