Fixed upgrade database error in script.
Fixed upgrade database error in script.