Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-8793

Flyway error when upgrading from older release to 0.8.0

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.14.0
    • NiFi Registry
    • None

    Description

      When taking an H2 database from 0.3.0 and dropping it into 0.8.0 or 0.9.0-SNAPSHOT, it produces the following error:

      Caused by: org.flywaydb.core.api.FlywayException: Found non-empty schema(s) "PUBLIC" without schema history table! Use baseline() or set baselineOnMigrate to true to initialize the schema history table.
              at org.flywaydb.core.Flyway$1.execute(Flyway.java:177)
              at org.flywaydb.core.Flyway$1.execute(Flyway.java:149)
              at org.flywaydb.core.Flyway.execute(Flyway.java:511)
              at org.flywaydb.core.Flyway.migrate(Flyway.java:149)
              at org.apache.nifi.registry.db.CustomFlywayMigrationStrategy.migrate(CustomFlywayMigrationStrategy.java:88)
              at org.springframework.boot.autoconfigure.flyway.FlywayMigrationInitializer.afterPropertiesSet(FlywayMigrationInitializer.java:62)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1855)
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1792)
              ... 98 common frames omitted 

      Looks like the issue is because Flyway changed their default table name at some point.

      https://github.com/flyway/flyway/issues/1848

      The issue does not happen going from 0.7.0 to 0.8.0, or 0.3.0 to 0.7.0, which is probably because 0.8.0 changed the Flyway version from 5.x to 6.x.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              bbende Bryan Bende
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h