Change database schema used by Spring Boot

前端 未结 3 1380
不思量自难忘°
不思量自难忘° 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条回答
  •  -上瘾入骨i
    2020-11-28 08:30

    It depends on the DataSource implementation which property has to be used to set the default schema (reference). With HikariDataSource for example spring.jpa.properties.hibernate.default_schema is ignored and you have to set

    spring.datasource.hikari.schema=schema
    

    See the complete list of HikariCP configuration parameters here.

提交回复
热议问题