And here are the matching drop and create statements:
ALTER TABLE `mytable`
DROP FOREIGN KEY `fk_mytable_id`;
ALTER TABLE `mytable`
ADD CONSTRAINT `fk_mytable_id`
FOREIGN KEY ( `id` )
REFERENCES `anothertable` ( `id` )
ON UPDATE CASCADE ON DELETE RESTRICT;
I don't know what I was doing wro
Just found this added the name:
ALTER TABLE `mytable`
ADD FOREIGN KEY `fk_mytable_id` ( `id` )
REFERENCES `othertable` ( `id` );
I thought I had tried that - obviously not.
--
View this message in context:
http://www.nabble.com/Add-foreign-key-tf2950373.html#a8251427
Sent from the MySQL - Ge