You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an application contains multiple DataSource beans, EntityManagerFactoryBuilder will default ddl-auto to a value that may only be appropriate for the primary DataSource #44516
After updating Spring Boot from 3.3.5 to 3.4.3, the default ddl-autocreate-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?
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.