I need to create a new schema in Postgres when the spring boot loads. So, it should check if the schema doesn't exist then create a new schema. I am using application.properties for database configuration.
spring.datasource.platform=postgres
spring.datasource.url=jdbc:postgresql://${vcap.services.postgresql-lite.credentials.hostname}:${vcap.services.postgresql-lite.credentials.port}/${vcap.services.postgresql-lite.credentials.dbname}
spring.datasource.username=${vcap.services.postgresql-lite.credentials.username}
spring.datasource.password=${vcap.services.postgresql-lite.credentials.password}
spring.jpa.properties.hibernate.default_schema=${DATABASE_SCHEMA}
spring.jpa.hibernate.ddl-auto=update
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect
The default schema that Postgres uses is public, I need to change that make my own schema, which I'll define in env.