在 H2 数据库中的一些 sql 语句时出现错误。这些 sql 语句来自 Hibernate SchemaExport
:这里是 sql 语句:
create table CONTACTS (
person_id bigint not null,
contact_id bigint not null,
primary key (person_id, contact_id)
)
create table PERSON (
id bigint generated by default as identity,
FNAME varchar(55),
NAME varchar(55),
primary key (id)
)
alter table CONTACTS
add constraint UK_r5plahp7wqcsd47hscckyrxgd unique (contact_id)
alter table CONTACTS
add constraint FK_r5plahp7wqcsd47hscckyrxgd
foreign key (contact_id)
references PERSON
alter table CONTACTS
add constraint FK_90n1kse999lanaepr0v6hcgtv
foreign key (person_id)
references PERSON
例如,此行不会在 H2 中执行。
错误说:[ERROR] Caused by org.h2.jdbc.JdbcSQLException: Syntax error in SQL statement : CREATE TABLE CONTACTS ( .... <<The same code from above>>
如何让这个 SQL 语句在 H2 中运行。