Only add UNIQUE KEYs after updating the data
Merge branch 'master' into ICPC-live

* master:
  Only add UNIQUE KEYs after updating the data