Skip to content

Support optional: prefix for DDL and DML script locations #25487

@wilkinsona

Description

@wilkinsona

At the moment classpath*:schema.sql and classpath*:data.sql are hardcoded fallback locations for DataSource initialization when spring.datasource.schema and spring.datasource.data haven't been set. When initialization falls back to these locations, the scripts become optional and won't fail if none are found.

The hardcoded nature of the fall back hurts the reusability of the initialization as, if you have multiple DataSources, you can't have multiple different fallback locations. To have different locations they have to be configured which loses the fallback behaviour of not requiring the scripts to exist.

To improve the reusability of DataSource initialization we should support an optional: prefix on a location which means that initialization will continue if no scripts are found in the specified location. This will also align its behaviour with optional spring.config.import values.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions