title: Trying to set up a H2 database for Spring development against a PostgreSQL database
body: <p>I'm setting up a small SpringBoot application that will be using PostgreSQL as database. My idea for development was to use a H2 embedded database "passing as" the Postgre database, but I'm not really understanding what I need to do to set up everything:</p>
  
  <p>1) Just in case, we are using Gradle for dependency management:</p>
  
  <pre><code>compile group: 'com.h2database', name: 'h2', version: '1.3.148' 
  compile group: 'org.springframework', name: 'spring-jdbc', version: '5.2.6.RELEASE'
  compile group: 'org.springframework.boot', name: 'spring-boot-starter-jdbc', version: '2.3.0.RELEASE'
  </code></pre>
  
  <p>2) This is my application-dev.properties ("dev" is the profile I'm running the application) (Updated after a comment down below and after reading <a href="https://stackoverflow.com/questions/37788029/spring-boot-populate-h2-database-with-schema-sql-and-data-sql">this other question</a>):</p>
  
  <pre><code>spring.datasource.url=jdbc:h2:mem:testdb;MODE=PostgreSQL
  spring.datasource.driverClassName=org.h2.Driver
  spring.datasource.username=sa
  spring.datasource.password=password
  
  spring.datasource.schema=classpath:/sql/schema.sql
  spring.datasource.data=classpath:/sql/data.sql
  spring.datasource.initialize=true
  
  spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
  </code></pre>
  
  <p>3) (Updated) schema.sql is our database creation script, data.sql is the data script (obviously) and both are in /resources/sql.</p>
  
  <p>The issue here is that the application starts, it loads the profile (<code>The following profiles are active: dev</code>), but when going to the h2 console, the database's empty. I even tried to change the name of the script (to "_ddl.sql") and the application just starts the same, as if it wasn't even trying to find the file.</p>
  
  <p>Also, does it make sense to mark <code>GenericPostgreSQL</code> on the H2 console options when login?</p>
  
  <p>Any leads on what I'm missing here? </p>