Where is H2 database when using Spring Boot and Heroku?

Viewed 354

I am using H2 database with Java Spring Boot and Heroku. Here is my application.properties:

spring.datasource.driverClassName=org.h2.Driver
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
spring.datasource.url=jdbc:h2:./database

When I run app locally, files database.mv.db and database.trace.db are created in root of project. However when I deploy this project to Heroku, and run:

heroku login
heroku run bash --app myappname
ls

I don't see any database files in project root. But the app still works and stores the data in the database. However, after the server restarts, the database is empty. Does this mean that Heroku only runs the H2 database in-memory? Or is there any way to set H2 on Heroku as persistent storage?

0 Answers
Related