Update of database upgrade query