Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "create table question (question_id bigint generated by default as identity, created_at timestamp, last_modified_at timestamp, content varchar(10000) not null, [*]like bigint not null, title varchar(255) not null, view bigint not null, answer_id bigint, primary key (question_id))"; expected "identifier"; SQL statement:
create table question (question_id bigint generated by default as identity, created_at timestamp, last_modified_at timestamp, content varchar(10000) not null, like bigint not null, title varchar(255) not null, view bigint not null, answer_id bigint, primary key (question_id)) [42001-214]
Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Table "QUESTION" not found; SQL statement:
@NoArgsConstructor
@Getter
@Setter
@Entity
public class Question extends Auditable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private long questionId;
@Column(nullable = false)
private String title;
@Column(nullable = false, length = 10000)
private String content;
@Column(nullable = false)
private long view;
@Column(nullable = false)
private long like;
@ManyToOne
@JoinColumn(name = "ANSWER_ID", nullable = false)
private Member member;
@OneToMany(mappedBy = "question")
private List<Answer> answers;
@OneToOne
@JoinColumn(name = "ANSWER_ID", insertable = false, updatable = false)
private Answer bestAnswer;
}
발생 원인
해결 방법