I am trying to add a column to one of my database tables, but there is a syntax error and I cannot find the problem ...
My current database table looks like this:
component + tag_id + item_id ------------|----------|----------- com_content | 23 | 2642 com_content | 26 | 3481 com_content | 35 | 1868 com_content | 85 | 5827 com_content | 89 | 7882
I want it to look like this where "id" is auto-increment and all columns are part of the primary key
id + component + tag_id + item_id -----|--------------|----------|----------- 1 | com_content | 23 | 2642 2 | com_content | 26 | 3481 3 | com_content | 35 | 1868 4 | com_content | 85 | 5827 5 | com_content | 89 | 7882
This is my request:
DROP PRIMARY KEY ALTER TABLE gitags_items ADD COLUMN id INT NOT NULL AUTO_INCREMENT FIRST PRIMARY KEY (id,component,tag_id,item_id)
However, I get this error message:
Any hints / pointers would be much appreciated
source share