org.hibernate.tool.hbm2ddl.SchemaUpdate does not add new columns to existing table definitions

96 Views Asked by At

We recently upgraded from Hibernate 4.3 to Hibernate 5.4.

Previously we used to use invoke the SchemaUpdate in the following manner

 new SchemaUpdate(sessionFactory.getConfiguration()).execute(false, true);

This would create new tables and update existing tables with any new columns that were created.

After we upgraded to Hibernate 5.4, we have changed it to the following

schemaUpdate.execute(EnumSet.of(TargetType.DATABASE), metadata, serviceRegistry);

This still creates the new tables,but does not add any new columns added to existing table definitions.

In the previous version, the execute method had a doUpdate argument which am not sure how to pass in to schemaUpdate anymore in 5.4

Thank you for your time and support

0

There are 0 best solutions below