My spring-boot configuration is:
spring:
profiles: database
datasource:
platform: mysql
continueOnError: false
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/test
username: root
data: data-mysql.sql
schema: schema-mysql.sql
batch:
initializer:
enabled: true
initialize-schema: always
job:
enabled: true
jpa:
database-platform: org.hibernate.dialect.MySQLDialect
show-sql: true
hibernate:
ddl-auto: create-drop
My expectation is:
spring-batchschemawill be created each time from very beginning;customertable specified in theschema-mysql.sqlwill be created every start time;customerdata will specified in thedata-mysql.sqlbe populated every start time;
But the actual result is:
spring-batchschemais created only first time;customertable never populated with data;customertable never created;
Question:
How should I change my configuration to get next result:
- I'm ok if
spring-batchschemais created only once or every start time (but it should be created for absence case); customertable should be created only once or every time;customertable should be populated with data if no data there.
Details:
- spring-boot 2.2.0.M3;
- Gradle 5.4.1;
- mariadb.
ddl-auto=neveror absent also doesn't work)