ddddddebuging
Cannot delete or update a parent row: a foreign constraint fails
kooby
2020. 5. 7. 10:31
에러 로그
### Cause: java.sql.SQLIntegrityConstraintViolationException: (conn=4502) Cannot delete or update a parent row: a foreign key constraint fails (`kooboard`.`board`, CONSTRAINT `reply` FOREIGN KEY (`b_index`) REFERENCES `board` (`b_index`))
board테이블에 있는 글을 삭제할 때, reply테이블의 b_index가 board테이블의 b_index에 외래키로 묶여 있기 때문에 다음과 같은 에러가 발생하였다.

서비스레벨에서 참조되어있는 테이블의 row를 먼저 삭제 해 준 후, 실행함으로써 오류를 해결할 수 있었다.