Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add static variables to prevent typos in the metadata tables string path #4586

Open
spring0913 opened this issue May 5, 2024 · 1 comment
Labels
status: waiting-for-triage Issues that we did not analyse yet type: feature

Comments

@spring0913
Copy link

spring0913 commented May 5, 2024

From the #4252, I realized that I had to use addScript to create the metadata table when using an In-memory database in Spring Boot 3.0 / Spring Batch 5.0.

I think it is better to use static variables to prevent typos in the metadata table creation script path string.

After I create PR about this(schema-h2), if it is approved, I would like to add static variables to the other databases as well.

AS-IS

@Bean
public DataSource dataSource() {
    return new EmbeddedDatabaseBuilder()
		.addScript("/org/springframework/batch/core/schema-h2.sql")
		.build();
}

TO-BE

@Bean
public DataSource dataSource() {
    return new EmbeddedDatabaseBuilder()
		.addScript(DatabaseResource.SCHEMA_H2)
		.build();
}
@spring0913 spring0913 added status: waiting-for-triage Issues that we did not analyse yet type: feature labels May 5, 2024
@spring0913 spring0913 changed the title Add static variables to prevent typos in the metadata table creation script path string Add static variables to prevent typos in the metadata tables string path May 5, 2024
spring0913 added a commit to spring0913/spring-batch that referenced this issue May 5, 2024
@injae-kim
Copy link
Contributor

Fix PR: #4587

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage Issues that we did not analyse yet type: feature
Projects
None yet
Development

No branches or pull requests

2 participants