I have MySQL installed and running, and now am trying to add a foreign key to a table. Every foreign key I have added to all the other tables works, but in this table it simply refuses. I have a table Clients and a table Fees. Clients has a PKEY of ClientID and Fees has a column ClientID that has been indexed. All types are the exact same. When I run the alter table command, I get the error that SHOW INNODB STATUS gives:
No Index Defined on ClientID
040418 18:51:23 Error in foreign key constraint of table wildcatvideoservice/#sql-4f48_653:
Cannot find an index in the referenced table where the
referenced columns appear as the first columns, or column types
in the table and the referenced table do not match for constraint:
FOREIGN KEY (`ClientID`) REFERENCES `Clients`(`ClientID`) ON UPDATE CASCADE
See
http://www.innodb.com/ibman.html for correct foreign key definition.
Please Help!