table 을 drop 하기 전에 의존성을 확인해야 한다.

다음 쿼리를 이용해서 확인할 수 있다.

 

SELECT COUNT(1) FROM information_schema.table_constraints
WHERE table_schema = 'mydb'
AND table_name = 'mytable'
AND constraint_type='FOREIGN KEY';

 

출처 : https://dba.stackexchange.com/a/5449

 

 

 

+ Recent posts