I’m changing my mysql db table from an id (auto) to a uid.
ALTER TABLE companies DROP PRIMARY KEY;
ALTER TABLE companies ADD PRIMARY KEY (`uuid`);
This is the error I get..
[SQL] ALTER TABLE companies DROP PRIMARY KEY;
[Err] 1075 - Incorrect table definition; there can be only one auto column and it must be defined as a key
Which I understand, I need to change the id to a non-autoincrement because I drop it as the primary key.? What is the syntax to change a column to remove primary key and auto increment?
ALTER TABLE companies change id id ?????????? int(11)
If you need to remove the auto-increment and the primary key from the
idcolumn in a single SQL statement, this should do:In fact, you should be able to do everything in a single
ALTER TABLEquery: