Ok, one can remove PRIMARY KEY CONSTRAIN FROM a column with:
ALTER TABLE table_name DROP PRIMARY KEY;
But how do you also remove auto increment from the same column so that the column no longer generates an automatic value upon INSERT?
Ok, one can remove PRIMARY KEY CONSTRAIN FROM a column with:
ALTER TABLE table_name DROP PRIMARY KEY;
But how do you also remove auto increment from the same column so that the column no longer generates an automatic value upon INSERT?
spent 5 min and cannot find the answer, so i think easiest way is to do the following:
you can alter the column and just redefine it without the auto_increment tag:
ALTER TABLE mytable CHANGE my_col my_col INT(10) UNSIGNED NOT NULL
Harder to make it dynamic though