Fixed upgrade SQL issue.