When hbm2ddl.auto is set to update all tables and keys are checked to see if changes are needed. The algorith by which the names of the foreign keys are generated changed the last couple of versions. Now the update thinks the foreign keys don't exist and creates them again. By changing findMatchingForeignKey in SchemaMigratorImpl to check the actual reference and fields that could be a lot smarter. So don't purely match on keyname but instead on the field and the referenced table with the referenced field. |