从数据库错误开始的Grails有人见过这个

Sag*_*ael 6 ddl grails

我今天开始申请,当它开始时,我得到了这个错误

| 错误2012-09-14 13:54:17,608 [pool-7-thread-1]错误hbm2ddl.SchemaExport - 不成功:创建表顺序(默认情况下生成的id bigint为identity,version bigint not null,date_created timestamp not null,order varchar(255)not null,picture_id bigint not null,posts_id bigint not null,主键(id))

| 错误2012-09-14 13:54:17,609 [pool-7-thread-1]错误hbm2ddl.SchemaExport - SQL语句中的语法错误"CREATE TABLE ORDER [*](ID BIGINT由DEFAULT生成IDENTITY,VERSION BIGINT NOT NULL ,DATE_CREATED TIMESTAMP NOT NULL,ORDER VARCHAR(255)NOT NULL,PICTURE_ID BIGINT NOT NULL,POSTS_ID BIGINT NOT NULL,PRIMARY KEY(ID))"; 预期的"标识符"; SQL语句:创建表顺序(默认情况下生成的id bigint为identity,version bigint not null,date_created timestamp not null,order varchar(255)not null,picture_id bigint not null,posts_id bigint not null,primary key(id))[ 42001-164]

| 错误2012-09-14 13:54:17,621 [pool-7-thread-1]错误hbm2ddl.SchemaExport - 不成功:alter table order add constraint FK651874E9A8021F6 foreign key(posts_id)references post

| 错误2012-09-14 13:54:17,621 [pool-7-thread-1]错误hbm2ddl.SchemaExport - SQL语句中的语法错误"ALTER TABLE ORDER [*] ADD CONSTRAINT FK651874E9A8021F6 FOREIGN KEY(POSTS_ID)REFERENCES POST"; 预期的"标识符"; SQL语句:alter table order add constraint FK651874E9A8021F6 foreign key(posts_id)references post [42001-164]

| 错误2012-09-14 13:54:17,621 [pool-7-thread-1]错误hbm2ddl.SchemaExport - 不成功:alter table order add constraint FK651874ED45FCA4B外键(picture_id)参考图片

| 错误2012-09-14 13:54:17,621 [pool-7-thread-1]错误hbm2ddl.SchemaExport - SQL语句中的语法错误"ALTER TABLE ORDER [*] ADD CONSTRAINT FK651874ED45FCA4B FOREIGN KEY(PICTURE_ID)REFERENCES PICTURE"; 预期的"标识符"; SQL语句:alter table order add constraint FK651874ED45FCA4B外键(picture_id)参考图片[42001-164]

谁看过这个吗?

Mr.*_*Cat 20

GORM中不允许使用某些键:order,group或任何其他SQL关键字; 你也不能命名域类User,Group(PostgreSQL).
修复它读取映射并更改表名和列.


Sag*_*ael 6

我发现你不能拥有名称的字段或域:order,group或任何其他SQL关键字.