Issue
I got a task, to create a basic app with some database handling. I'm really new at this, the whole spring boot and stuff. I did all the GET, PUT, POST, DELETE stuff without writing any line of SQL, starts with table creation. But they asked me to provide the SQL script, how I managed to create the database structure, connections and stuff. How can I solve this problem?
Solution
Add following to spring.jpa.properties
spring.jpa.properties.javax.persistence.schema-generation.scripts.action=create
spring.jpa.properties.javax.persistence.schema-generation.scripts.create-target=create.sql
spring.jpa.properties.javax.persistence.schema-generation.scripts.create-source=metadata
Please refer this article https://www.baeldung.com/spring-data-jpa-generate-db-schema by @baeldung for more detail.
Answered By - Vipul