I have an InnoDb table with a named UNIQUE CONSTRAINT. The constraint has been created with an ALTER TABLE script:
Now I need to add field2 to the constraint with an ALTER script to update old databases (I can't drop and re-create the table). I've tried with
but it don't work.
Anyone can help?
Code:
ALTER TABLE MyTable
ADD CONSTRAINT UN_MyTable UNIQUE (field1);
Now I need to add field2 to the constraint with an ALTER script to update old databases (I can't drop and re-create the table). I've tried with
Code:
ALTER TABLE MyTable
ALTER CONSTRAINT UN_MyTable UNIQUE(field1, field2);
but it don't work.
Anyone can help?