fix upgrade db script