Debuging
-
SQLIntegrityConstraintViolationExceptionDebuging 2022. 8. 31. 22:06
Cannot add or update a child row: a foreign key constraint fails (`stepstone`.`#sql-1898_92`, CONSTRAINT `FKkth6nbx4fl29impm13x6q94x6` FOREIGN KEY (`ChatRoomEntity_chat_room_cid`) REFERENCES `chat_rooms` (`chat_room_cid`)) 멋사 해커톤 프로젝트에서 ManyToMany 매핑을 설정하던 중 다음 에러가 발생했다. 그리고 db에 들 어가보니까 다음과 같이 컬럼이 새로 생성됐다. ManyToMany annotation으로 자동 외래키 설정하던 중 컬럼의 이름을 잘못 설정하는 것 같았다. 구글링하여 조인 테이블과 컬럼을 다음과 같이 설정해주..