I've got problem with dropping foreign key index, I always get the same error
ALTER TABLE `comments` DROP INDEX `id_user`
which outputs
1025 - Error on rename of './postuj_cz1/#sql-d834_a0c704'
to './postuj_cz1/comments' (errno: 150)
The id_user on the other table is simple primary key index.
I'm using MySQL version 5.0.85
According to this link, the error relates to the definition of the primary key field. The error isn't about the foreign key index.
Check the primary key for the
COMMENTStable to make sure it does not have theUNSIGNEDkeyword while theCOMMENTS.id_userforeign key had the UNSIGNED keyword. This keyword was causing the problem - inconsistent type of field.To fix, add the
UNSIGNEDkeyword to the primary key definition for theCOMMENTStable. Or remove theUNSIGNEDkeyword from the foreign key definition...