I'm migrating my application from 4.2.2.Final to 5.2.8.Final. Because I use envers, I need to set the property hbm2ddl to update. When I start the server, Hibernate returns these errors:
It complains about tables and FK, even about the table REVINFO with all the envers' history. It never happened with Hibernate 4, even after restoring an existing db.
Do you know how to fix it? Is it a bug? I can't crearly delete the tables.
The dialect I'm using is org.hibernate.dialect.SQLServer2008Dialect
FWIW, you do not need to use that setting because you're using Envers. While that setting is nice to migrate or create database objects after you've made some developer changes, its really something that isn't necessary as there exists other ways including Hibernate's tooling tasks for creating schema scripts that you can use.
You mention the setting is set to true, why? The value's proper value-set is create, create-drop, validate, or validate. Is the setting something you're passing directly to Hibernate or is this some hbm2ddl setting you're providing to a third-party like Spring Data?
Sorry, I meant set to "update", I edited the description now.
As you said, I set it to "none" now and it seems that envers is still working, this s good news.
Besides, I'd like to understand how to prevent hibernate to create objects (tables and FK) that already exist.
Mind attaching a test case that replicates this failure for us with two simple entities? It seems strange that you'd get an object exists error while using update ?