Change database schema used by Spring Boot

前端 未结 3 1391
不思量自难忘°
不思量自难忘° 2020-11-28 08:00

How do I specify database schema used by Spring Boot? I am using default hibernate (=default) and postgres (but i hoping for a generic solution). I know how to specify JDBC

3条回答
  •  生来不讨喜
    2020-11-28 08:34

    Use spring.jpa.properties.hibernate.default_schema=schema.

    From the Spring Boot reference guide:

    all properties in spring.jpa.properties.* are passed through as normal JPA properties (with the prefix stripped) when the local EntityManagerFactory is created

    See http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#howto-configure-jpa-properties

    For a full list of available properties see http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#howto-configure-jpa-properties

提交回复
热议问题