After updating Spring Boot from 3.3.5 to 3.4.3, the default ddl-auto create-drop will be applied to the non-embedded database if project has two databases, one of them is an embedded db and no explicit value is set for spring.jpa.hibernate.ddl-auto in application properties. Is this a bug or an intended behavior?

The current documentation for Database Initialization mentions the following:

If an embedded database is identified and no schema manager (Flyway or Liquibase) has been detected, ddl-auto defaults to create-drop. In all other cases, it defaults to none.

which gives impression that create-drop will be applied by default only to the embedded database. However, sometime between Spring Boot 3.3.5 and 3.4.3 a change was made so that default value create-drop for spring.jpa.hibernate.ddl-auto was applied to all data sources whether they were embedded or not (if at least one of them was embedded), which is dangerous behaviour and can lead to unexpected data loss in production databases.

Comment From: wilkinsona

Please provide a minimal sample that reproduces the behavior you have described. There are too many unknowns at the moment in terms of how the two databases and the entity managers that depend on them are configured.

Comment From: randomComitter

@wilkinsona thanks for your reply.

Sure, here's a minimal project that reproduces described behavior: https://github.com/randomComitter/dropcreate