Does anyone knows if there's a way for Grails to check if a referential constraint he is trying to create already exists?
Unfortunately, I can't drop the database and create it again, because of the enviroment in wich it is and my company policy, size of the database, etc.
It throws me an error that I would not want it to exist in production enviroment:
[main] ERROR hbm2ddl.SchemaUpdate - Unsuccessful: alter table <TABLE> add constraint <CONSTRAINT> foreign key (<FK>) references <THEOTHERTABLE>
[main] ERROR hbm2ddl.SchemaUpdate - ORA-02275: such a referential constraint already exists in the table.
Edit: This happened when I tried to correct the name of a Table column that is a foreign key from another table.
Oracle 10g Grails 1.3.9
Use hibernate.hbm2ddl.auto=validate. This will not try to makes any change in your schema, just "validate" what you map in your POJOs with the database schema.
Also you can set your logger to "debug" level and you will check what Hibernate is doing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With