I want to initialise schema using spring.jpa.generate-ddl=true and then populate using data.sql.
I tried it but it doesn't seem to work without schema.sql. Any suggesstions?
Add below config to your application.properties or application.yml file:
spring.jpa.hibernate.ddl-auto=create
spring.datasource.initialization-mode=always
and use below config if you have data in the table:
spring.jpa.hibernate.ddl-auto=update
spring.datasource.initialization-mode=always
See this question and its answer.
spring.jpa.defer-datasource-initialization=true
will load your data.sql script after your table is generated.