@OneToMany tableA
@ManyToOne tableB
일 때,
외래키 제약조건때문에 A 삭제 -> B 삭제가 안될 경우
=> cascade 추가해야함 !
show create table tableB;
ALTER TABLE tableB DROP FOREIGN KEY (FK);
ALTER TABLE tableB
ADD CONSTRAINT FK_tableB_tableA
FOREIGN KEY (tableA_id) REFERENCES tableA(id)
ON DELETE CASCADE;
ALTER TABLE article
ADD CONSTRAINT 쏼라쏼라
FOREIGN KEY (user_id)
REFERENCES user(id)
ON DELETE CASCADE;