I'm using PostgreSQL
and spring-boot-2.0.1
and want my app to create the database if it doesn't exist.
I have the below options in my application.properties
spring.jpa.hibernate.ddl-auto=update
spring.jpa.generate-ddl=true
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQL94Dialect
spring.datasource.driverClassName=org.postgresql.Driver
spring.datasource.url=jdbc:postgresql://localhost:5432/mydb
spring.datasource.username=postgres
spring.datasource.password=123
with the above i'm getting error:
Caused by: org.postgresql.util.PSQLException: FATAL: database "mydb" does not exist
any idea what i'm missing?