Spring Boot spring.datasource.schema VS spring.jpa.properties.hibernate.default_schema Spring Boot spring.datasource.schema VS spring.jpa.properties.hibernate.default_schema postgresql postgresql

Spring Boot spring.datasource.schema VS spring.jpa.properties.hibernate.default_schema


spring.datasource.schema is used by Spring boot to load a file with sql into your database. If you use this Postgres will think you want to use the default 'public' schema.

spring.jpa.properties.hibernate.default_schema Tells Hibernate which schema in Postgres that you want to use. By setting this per your example, Postgres will use the 'sample' schema.