You have to drop the foreign key relation before you can drop the index. Have a look at the output of
SHOW CREATE TABLE likes
It will show you the internal name of the foreign key constraint which you set up with your first statement. You have to drop this foreign key with
ALTER TABLE likes DROP FOREIGN KEY key_name
before you can drop the index on the foreign key field. InnoDB relies on indexes on all key columns in a foreign key constraint.
smantscheff
Nearly a Posting Virtuoso
1,233 posts since Oct 2010
Reputation Points: 300
Solved Threads: 254