MySQL Forums
Forum List  »  Newbie

hibernate alter table drop constraint
Posted by: Joske
Date: August 18, 2004 03:00PM

Hello,

I use Hibernate for a web application. When I last week upgraded to Hibernate 2.1.6 and I tried to generate the tables with SchemaExport, the first lines he generates in the SQL file is:
alter table GROUPS drop constraint FK7DD0CDD4D1B;
alter table USER_GROUP drop constraint FKC62E00EB4CD4DEFB;
alter table USER_GROUP drop constraint FKC62E00EB2206F20F;
...

This generates a MySQL syntax error: "#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'constraint FK7DD0CDD4D1B' at line 1 ".

I checked this with the MySQL documentation and as far as I can see MySQL does not support "alter table drop constraint" construct. However, nobody at the Hibernate forum seems to have encountered the same problem. And when I noted it, one person responded that it works fine for him on MySQL 4.0.

I use MySQL 4.0.20a-debug on Win32. Is there some setting in the my.ini file I can set so that this check is not done anymore or overruled ?

Kind regards,

Jos

Options: ReplyQuote


Subject
Written By
Posted
hibernate alter table drop constraint
August 18, 2004 03:00PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.