Changing Key Column From INT to VARCHAR

swisstoni

Registered User.
Local time
Today, 04:07
Joined
May 8, 2008
Messages
61
Hey,

I'd like to change my key column in a table from an auto increment Integer to a VarChar, but MySQL wont let me do this.

Whenever I try to change the type, I get MySQL error 1025 - error renaming table.

I think it's probably because the key is referenced in other tables as a foreign key as type INT (though feel free to correct me if I'm wrong!)

Any idea how I could go about cascading this change onto the other referenced tables?
 
Ah, apologies - got it sorted - just deleted the foreign keys, changed the type and set the keys back up!
 

Users who are viewing this thread

Back
Top Bottom