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.

Comment From: chaundhyan

@wilkinsona : Shall I pick this up? You can assign it to me if you haven't started yet. Thanks

Comment From: wilkinsona

Thanks for the offer, @chaundhyan. I'm already working on this one as part of some broader changes to DataSource initialization.