title: Flyway integration with spring boot doesn't execute migration scripts on embedded H2 database
body: <p>I am trying to make migration demo on embedded H2 data base in Spring Boot application using Flyway.</p>
  
  <p><strong>application.properties</strong></p>
  
  <pre><code>logging.level.org.org.springframework=DEBUG
  server.port=8181
  spring.h2.console.enabled=true
  spring.h2.console.path=/h2
  spring.datasource.url=jdbc:h2:mem:testdb
  spring.datasource.username=sa
  spring.datasource.password=
  spring.datasource.driver-class-name=org.h2.Driver
  spring.flyway.baseline-on-migrate=true
  spring.jpa.hibernate.ddl-auto=none
  </code></pre>
  
  <p>migration-script(V2__create_shipwreck.sql) under db/migration  </p>
  
  <pre><code>CREATE TABLE SHIPWRECK(ID INT AUTO_INCREMENT,
      NAME VARCHAR(255),
      DESCRIPTION VARCHAR(2000),
      CONDITION VARCHAR(255),
      DEPTH INT,
      LATITUDE DOUBLE,
      LANGITUDE DOUBLE,
      YEARS_DISCOERED INT);
  </code></pre>
  
  <p><strong>console log</strong> </p>
  
  <blockquote>
    <p>INFO 7284 --- [main] o.f.c.internal.database.DatabaseFactory:
    Database: jdbc:h2:mem:testdb (H2 1.4)</p>
    
    <p>INFO 7284 --- [main] o.f.core.internal.command.DbValidate:
    Successfully validated 1 migration (execution time 00:00.031s)</p>
    
    <p>INFO 7284 --- [main] o.f.c.i.s.JdbcTableSchemaHistory: Creating Schema
    History table: "PUBLIC"."flyway_schema_history"</p>
    
    <p>INFO 7284 --- [main] o.f.core.internal.command.DbMigrate: Current
    version of schema "PUBLIC": &lt;&lt; Empty Schema >></p>
    
    <p>INFO 7284 --- [main] o.f.core.internal.command.DbMigrate: Migrating
    schema "PUBLIC" to version 2 - create shipwreck</p>
    
    <p>INFO 7284 --- [main] o.f.core.internal.command.DbMigrate :
    Successfully applied 1 migration to schema "PUBLIC" (execution time
    00:00.098s)</p>
    
    <p>INFO 7284 --- [main] j.LocalContainerEntityManagerFactoryBean :
    Building JPA container EntityManagerFactory for persistence unit
    'default'</p>
    
    <p>INFO 7284 --- [main] o.hibernate.jpa.internal.util.LogHelper  :
    HHH000204: Processing PersistenceUnitInfo [name: default...]</p>
    
    <p>main] org.hibernate.Version                    : HHH000412: Hibernate
    Core {5.2.14.Final}</p>
    
    <p>main] org.hibernate.cfg.Environment            : HHH000206:
    hibernate.properties not found</p>
    
    <p>main] o.hibernate.annotations.common.Version   : HCANN000001:
    Hibernate Commons Annotations {5.0.1.Final}</p>
    
    <p>main] org.hibernate.dialect.Dialect            : HHH000400: Using
    dialect: org.hibernate.dialect.H2Dialect</p>
    
    <p>main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA
    EntityManagerFactory for persistence unit 'default'</p>
  </blockquote>
  
  <p><strong>pom.xml</strong></p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;com.boot&lt;/groupId&gt;
      &lt;artifactId&gt;das-boot&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;packaging&gt;jar&lt;/packaging&gt;
      &lt;name&gt;das-boot&lt;/name&gt;
      &lt;url&gt;http://maven.apache.org&lt;/url&gt;
  
      &lt;parent&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
          &lt;version&gt;2.0.0.RELEASE&lt;/version&gt;
      &lt;/parent&gt;
  
      &lt;properties&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;/properties&gt;
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-data-jpa&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.h2database&lt;/groupId&gt;
              &lt;artifactId&gt;h2&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;version&gt;3.8.1&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
          &lt;groupId&gt;org.flywaydb&lt;/groupId&gt;
          &lt;artifactId&gt;flyway-core&lt;/artifactId&gt;
          &lt;version&gt;5.0.7&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.0.0.RELEASE&lt;/version&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;repackage&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p><strong>H2 database tables UI</strong></p>
  
  <p><a href="https://i.stack.imgur.com/wz5vd.png" rel="noreferrer"><img src="https://i.stack.imgur.com/wz5vd.png" alt="database tables"></a></p>
  
  <p>After starting the Spring Boot application, the table has not been created, so what's the problem here?</p>