Skip to content

Fix DataSourceInitializerConfiguration to use spring.sql.init.properties - #1071

Open
kishorein25 wants to merge 1 commit into
spring-projects-experimental:mainfrom
kishorein25:fix-134-datasource-properties
Open

kishorein25 wants to merge 1 commit into
spring-projects-experimental:mainfrom
kishorein25:fix-134-datasource-properties

Conversation

@kishorein25

@kishorein25 kishorein25 commented Oct 10, 2026 •

Copy link
Copy Markdown

Fixes #134

The generated DataSourceInitializerConfiguration referenced
spring.datasource.schema-username/password, which the
boot-2.4-2.5-sql-init-properties recipe renames afterwards,
breaking the generated configuration.

This change:

  • uses spring.sql.init.schema-locations
  • migrates schema credentials to spring.sql.init.username/password
  • fixes the data-password rename bug
  • preserves conflicting schema/data credentials instead of overwriting them
  • adds regression coverage for the migration behavior

Testing:

  • Boot_24_25_CreateDatasourceInitializerActionTest: passed
  • Boot_24_25*Test: 16 run, 0 failures, 0 errors, 3 skipped

The generated DataSourceInitializerConfiguration referenced spring.datasource
.schema-username and schema-password which get renamed by the sql-init-properties
recipe afterwards, breaking the configuration. Generate the configuration with
spring.sql.init property names and rename the deprecated datasource properties
in the datasource initializer action. Credentials are only renamed when schema
and data usernames match, since Boot 2.5 has a single spring.sql.init.username.

Signed-off-by: kishorein25 <ks6700822@gmail.com>
@kishorein25
kishorein25 force-pushed the fix-134-datasource-properties branch from a61cc79 to 80b80c4 Compare October 10, 2026 15:25

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change properties in DataSourceInitializerConfiguration

1 participant