What is wiping my H2 database every time I run a unit test?

后端 未结 1 1488
孤街浪徒
孤街浪徒 2021-01-24 09:36

I have a Spring+Hibernate+H2 project that I made by basing of an example I found on the Internet. It\'s working great except that every time I run a unit test, the db is wiped.

1条回答
  •  长情又很酷
    2021-01-24 10:22

    It's the property name="hibernate.hbm2ddl.auto" value="create" /> which is dropping n re-creating schema everytime. change it to update, so it will only create it first time if not there.

    See this link for more description: Link

    0 讨论(0)
提交回复
热议问题