Problem adding Foreign Key using Alter Table with existing MYSQL Database - can't add it! Help!
I have a production database where I have renamed several column's that are foreign keys. Obviously mysql makes this a real pain to do in my experience. My solution was to drop all the indexes and foreign keys, rename the id columns, and then re-add the indexes and foreign keys. This works great on mysql 5.1 on windows for the development database. I went to run my migration script on my debian server, which is also using mysql 5.1, and it gives the following error: mysql> ALTER TABLE `company_to_module` -> ADD CONSTRAINT `FK82977604FE40A062` FOREIGN KEY (`company_id`) REFERENCES `company` (