Skip to content

Non-embedded databases have schema/data.sql scripts applied by default #26682

@everflux

Description

@everflux

In my project I have mariadb and h2 dependencies and data.sql/schema.sql.
For development h2 is used, a 'dev' profile is used without spring.datasource.* properties and a 'prod' profile sets the properties for mariadb.

Before Spring Boot 2.5.0 the behaviour was to use schema.sql and data.sql for h2, but not for mariadb.
In Spring Boot 2.5.0 the schema.sql and data.sql are executed on each application start/reload.

While this change is surprising there may be good reasons for it, but it should be documented in a prominent manner, as it could lead to problems with production data.

Metadata

Metadata

Assignees

Labels

status: noteworthyA noteworthy issue to call out in the release notestype: regressionA regression from a previous release

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions