Hello,
I'm running MySQL 5.0.88 and I'm trying to create a script to modify my current database and I'm running in to errors when a CONSTRAINT already exists on a table.
Code:
ALTER IGNORE TABLE `Client_INFO` ADD CONSTRAINT `fk_cid_Client_Info` FOREIGN KEY (`cid`)
REFERENCES `ClientData` (`cid`) ON DELETE CASCADE;
It was my understanding, from the MySQL 5 docs that the Ignore would just fail silently. But that's not the case, at least not for me.
How can I check for the CONSTRAINT so that my script can continue?
Thanks,
tom