fix upgrade db lost unique statement