title: How to auto create postgresql schema (other than the default "public" one) using spring and hibernate
body: <p>I want to initialize a local postgresql db using spring and hibernate, but using:</p>
  
  <pre><code>spring.jpa.hibernate.ddl-auto=create
  spring.jpa.generate-ddl=true
  </code></pre>
  
  <p>it does not create the schema I have configured in my entity classes using <code>@Table(name = "table_name", schema = "schema_name")</code> and I get the error: </p>
  
  <blockquote>
    <p>Caused by: org.postgresql.util.PSQLException: ERROR: schema "schema_name" does not exist. </p>
  </blockquote>
  
  <p>Is there any way of creating the schema automatically?</p>