-
Notifications
You must be signed in to change notification settings - Fork 41.5k
Description
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.