I too get alter table errors when I use SchemaUpdate with MySQL (MyISAM table type):
Error while executing alter table Submission add index (membership), add constraint FKFB08176CB01D87D6 foreign key (membership) references Membership (id)
java.sql.SQLException: Invalid argument value, message from server: "Too many keys specified. Max 32 keys allowed"
I am running: Hibernate 2.0.3, MySQL Connector/J 3.0.8, MySQL 4.0.12
The Hibernate manual --
http://www.hibernate.org/hib_docs/refer ... guide-s1-6 -- points out:
"SchemaUpdate depends heavily upon the JDBC metadata API, so it will not work with all JDBC drivers"
I'm assuming these errors are a side effect of the fact that MySQL MyISAM tables do not support foreign keys. If you look at the SQL that SchemaUpdate is trying to run...
alter table Submission add index (membership), add constraint FKFB08176CB01D87D6 foreign key (membership) references Membership (id)
...and then read the MySQL manual for ALTER TABLE --
http://www.mysql.com/doc/en/ALTER_TABLE.html -- you will find:
"The FOREIGN KEY, CHECK, and REFERENCES clauses don't actually do anything, except for InnoDB type tables..."
So my question is: is this an inherent/known limitation or a bug?
If this is a known limitation, it would be nice if the manual included a list of the popular databases and their compatibility with SchemaUpdate.
Thanks.