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 wrong before.  Obviously the walk I took did
me the world of good.
-- 
View this message in context: 
http://www.nabble.com/Add-foreign-key-tf2950373.html#a8252094
Sent from the MySQL - General mailing list archive at Nabble.com.


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to