flyway

How to skip a specific migration with flyway?


I'm using flyway with gradle, I've run one of the migrations manually inside the database console, I want to run flyway, but tell it to ignore one specific migration version in between all the others.
Can this be done?


Solution

  • As of version 7, you can add it directly to your Maven or Grade file

    Gradle - Skip

    flyway {
         skipExecutingMigrations = true
    }
    

    Maven - Skip

    <configuration>
         <skipExecutingMigrations>true</skipExecutingMigrations>
    </configuration>
    

    Documentation Reference Skip

    Gradle - Cherry Pick

    flyway {
         cherryPick = '2.0'
    }
    

    Maven - Cherry Pick

    <configuration>
         <cherryPick>2.0</cherryPick>
    </configuration>
    

    Documentation Reference Cherry Pick