更新时间:2022-02-02 09:30:41
如果您需要在单个SQL语句中从id
列中删除自动增量和主键,则应该这样做:
If you need to remove the auto-increment and the primary key from the id
column in a single SQL statement, this should do:
ALTER TABLE companies DROP PRIMARY KEY, CHANGE id id int(11);
实际上,您应该能够在单个ALTER TABLE
查询中完成所有操作:
In fact, you should be able to do everything in a single ALTER TABLE
query:
ALTER TABLE companies
DROP PRIMARY KEY,
CHANGE id id int(11),
ADD PRIMARY KEY (uuid);