SG87
SG87

Reputation: 79

Migration from Hibernate 4 to 5 and foreign keys with hbm2ddl.auto set to update

I'm migrating my application from Hibernate 4 to 5. When I set the hibernate property hibernate.hbm2ddl.autoto update (needed to make the envers work) I receive a bunch of errors saying:

Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: There is already an object named 'FKdpu5x5cwbvck72kxs323m271e' in the database.

Since almost 6 months hibernate.hbm2ddl.auto is set to update, I've restored the db many times and never had this problem.

I tried to remove all the FK, but hibernate also complains about tables and PK. I already tried a different naming strategy, but it does not work.

I'm using hibernate 5.2.8.Final

Upvotes: 0

Views: 249

Answers (0)

Related Questions