If you have several foreign keys connected together and you get an error message that ends with errorno 15x , this most likely means that there are other tables that depend on the foreign key you are trying to delete.
To remove the foreign key, when you get this error, you will need to do SET FOREIGN_KEY_CHECKS = 0; and then you must first transfer the foreign keys to tables that have no other dependent tables. Then you can successfully delete the foreign keys in the next table in the chain, etc.
When you're done, make sure you run SET FOREIGN_KEY_CHECKS = 1; again SET FOREIGN_KEY_CHECKS = 1; .
Alex w
source share