Can I have H2 autocreate a schema in an in-memory database?

后端 未结 5 1999
逝去的感伤
逝去的感伤 2020-11-30 20:36

(I\'ve already seen the H2 database In memory - Init schema via Spring/Hibernate question; it is not applicable here.)

I\'d like to know if there\'s a setting in H2

5条回答
  •  醉酒成梦
    2020-11-30 21:14

    If you are using spring with application.yml the following will work for you

    spring: datasource: url: jdbc:h2:mem:mydb;DB_CLOSE_ON_EXIT=FALSE;MODE=PostgreSQL;INIT=CREATE SCHEMA IF NOT EXISTS calendar

提交回复
热议问题