Alter Table Error
Solution 1:
I would check to see if you have any foreign key references to that column. If so, you may need to remove the foreign relationships that you have defined for that column, then rename, then place your foreign key relationships back in place with the new column name.
I think MySQL is getting hung up on the fact that when you rename, the FK relationships are no longer valid and it is throwing an error.
EDIT: Confirmed FK Rename in MySQL
You will need to do something like this:
altertable yourTable dropforeign key yourID
Solution 2:
i think it might be a multi step process.
- add a new column,
- copy the data over from the original column
- drop the old column
Solution 3:
just having a quick search in google, and it looks like you are referencing the column in a foreign key - which is preventing the rename.
afraid i'm not sure how you'd resolve the problem, as I haven't used foreign keys in MySQL all that much
Post a Comment for "Alter Table Error"