MySQL增加唯一性约束

alter table user add constraint uk_code unique (code)

原文地址:https://www.cnblogs.com/GarfieldTom/p/1502210.html