Вопрос

when i am running my grails application i am getting schemaUpdate fail error;

    hbm2ddl.SchemaUpdate Unsuccessful: alter table lifecycle add index FKEDFAE76ABF1565B0 (round_up_emailed_updated_by_id), add constraint FKEDFAE76ABF1565B0 foreign
    key (round_up_emailed_updated_by_id) references user (id)
    hbm2ddl.SchemaUpdate Too many keys specified; max 64 keys allowed
    hbm2ddl.SchemaUpdate Unsuccessful: alter table lifecycle add index FKEDFAE76A166A0DC5 (training_advice_telecommunicated_updated_by_id), add constraint FKEDFAE76A1
    66A0DC5 foreign key (training_advice_telecommunicated_updated_by_id) references user (id)
    hbm2ddl.SchemaUpdate Too many keys specified; max 64 keys allowed
    hbm2ddl.SchemaUpdate Unsuccessful: alter table lifecycle add index FKEDFAE76AA40386D9 (laptops_arranged_actor_id), add constraint FKEDFAE76AA40386D9 foreign key (
    laptops_arranged_actor_id) references role (id)
    hbm2ddl.SchemaUpdate Too many keys specified; max 64 keys allowed

what does it mean? and what causes this error?

Это было полезно?

Решение

Although you did not post your database engine and version, I am going to take a guess that you are using MySQL 5.0 or greater.

I am using MySQL 5.5.25 and InnoDB as my engine, and came across the following discovery:

As of MySQL 5.0, there is a maximum of 64 indices per table.

Someone attempted to create a table having more than 64 foreign keys using MySQL 5.0 and got the exact text in their error message that you got:

Too many keys specified. Max 64 keys allowed

Here is their bug report on bugs.mysql.com Bug #51450.

If you are running MySQL 5.0 or greater and this is the error you are encountering, then it is not an issue with Grails or hbm2ddl, but with your underlying database engine.

Другие советы

Apparently you have specified too many foreign keys; apparently a maximum of 64 keys is allowed.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top