I want to drop an index, but I can't because is used in another table, but I can't find where
ALTER TABLE t_course DROP INDEX user_id
Is there a way to know where it is used ?
I want to drop an index, but I can't because is used in another table, but I can't find where
ALTER TABLE t_course DROP INDEX user_id
Is there a way to know where it is used ?
To find the other table that the constraints reference:
select COLUMN_NAME, CONSTRAINT_NAME, REFERENCED_COLUMN_NAME, REFERENCED_TABLE_NAME
from information_schema.KEY_COLUMN_USAGE
where TABLE_NAME = 't_course';
Take a look at the REFERENCED_TABLE_NAME returned from the above query.