I'm looking to generate an SQL script that creates the tables I need in the database based on the my configuration setup in Spring Boot.
I've got this application-prod.yml
config
spring:
datasource:
url: jdbc:oracle:thin:@removed:1521:XE
username: user
password: pass
jpa:
hibernate:
ddl-auto: none
naming:
physical-strategy: CustomPhysicalNamingStrategyImpl
properties:
hibernate:
default_schema: myschema
I used to just do ddl-auto: create-drop
, but that is no longer an option.
In ASP.NET Core I'm used to doing it via the command line. Like so:
> dotnet ef --output create.sql
And I'm done.
But I can't find an equivalent way for Spring Boot and Hibernate.
Right now it seems like I have to edit my config run the app, export the database schema via Oracle SQL Developer, then revert the config. Hope I don't forget something.
Surely this can't be the case...