인프런 커뮤니티 질문&답변
각 테이블들을 drop하려고 하는데 아래와 같은 에러가 납니다.
작성
·
391
퀴즈
A class using the `@Entity` annotation for JPA mapping must basically meet these important conditions: 1. It must have a no-argument constructor (default constructor). 2. It must have a field representing the primary key, usually marked with the `@Id` annotation. 3. The class itself cannot be `final`. 4. It cannot be an `enum` or an `interface`.
All fields must be public
must be a final class
Must have a public or protected default constructor
must include at least one static method
답변 1
0
안녕하세요
외래키로 연관된 다른 테이블이 묶여있어서 drop이 안되는 겁니다.
연관된 다른 테이블을 먼저 drop 해준 뒤에 처리를 해준다면 drop이 정상적으로 됩니다.
다른 방법으로는
cascade 옵션을 줘서 drop 명령어를 실행하면 됩니다.
사용법 : DROP TABLE {테이블명} CASCADE ;
작성자님의 경우에는
DROP TABLE CATEGORY CASCADE;
로 진행하시면 될 겁니다.












답변 감사합니다!!