An alternative way of addressing this would be to make Hibernate 5 check if the foreign key or unique constraint already existed, under whatever name, and only create it if it doesn't exist. This is the hibernate 4 behaviour. We currently have both JBoss72 (using Hibernate 4) and Wildfly10.1 (using hibernate 5) connecting to the same database schema. We can manage to get this to work by dropping all the hibernate 4 foreign keys and constraints and then starting up wildfly 10 so that hibernate 5 creates them again with the names it wants. When Jboss 72 (hibernate 4) next connects it sees that the constraints are there even though the names are not what it would use and doesn't try to recreate them. It would be great if Hibernate 5 could also check for the existence of constraints REGARDLESS OF NAME. |