Why Does This Drop Fail?

2010-07-22 Thread Victor Subervi
Hi; mysql alter table personalData drop foreign key Store; ERROR 1025 (HY000): Error on rename of './test/personalData' to './test/#sql2-14ce-a61' (errno: 152) mysql describe personalData; +---+--+--+-+++ | Field |

Re: Why Does This Drop Fail?

2010-07-22 Thread John Daisley
Most likely a foreign key constraint would be violated if the table were dropped. Check those index definitions on `Store` and `User` columns. Regards John Daisley Microsoft SQL Server 2005/2008 Database Administrator Certified MySQL 5 Database Administrator Certified MySQL 5 Developer Cognos

Re: Why Does This Drop Fail?

2010-07-22 Thread Victor Subervi
On Thu, Jul 22, 2010 at 8:47 AM, John Daisley daisleyj...@googlemail.comwrote: Most likely a foreign key constraint would be violated if the table were dropped. Check those index definitions on `Store` and `User` columns. But I don't want to drop the table, I want to drop the foreign key on

Re: Why Does This Drop Fail?

2010-07-22 Thread John Daisley
Sorry, my bad! Must learn to read the whole message!! This can be caused because when a foreign key is created mysql adds an index key to the column in addition to the foreign key. Why I'm not sure, but I'm guessing its for performance. To drop this foreign key First do this to get the index

Re: Why Does This Drop Fail?

2010-07-22 Thread Victor Subervi
On Thu, Jul 22, 2010 at 9:09 AM, John Daisley daisleyj...@googlemail.comwrote: Sorry, my bad! Must learn to read the whole message!! This can be caused because when a foreign key is created mysql adds an index key to the column in addition to the foreign key. Why I'm not sure, but I'm