Added check & execution for database upgrade