728x90
# 에러 :
JPA에서 프로젝트 실행할때 테이블이 만들어지는데. 아래 처럼 에러가 날때.
create table order (
id bigint generated by default as identity,
order_date timestamp(6) not null,
status varchar(255) check (status in ('PENDING','SHIPPED','DELIVERED','CANCELLED')),
user_id bigint not null,
primary key (id)
)" via JDBC [오류: 구문 오류, "order" 부근
Position: 20]
=> 이유 : PostgreSQL에서 위와 같은 에러가 나오면 테이블 이름이 예약어라서 오류 나는것.
# 해결 :
@Table(name = "orders")
public class Order {
테이블 이름을 예약어 피해 짓기
