Search code examples
flyway

want to add a new flyway in between existing schema version


I have version v1, v2 in schema_version table. I want to add version v1.1 in between. How can i do it using cmd's with out manually dropping v2 and running flyway migrate once again?


Solution

  • Run with outOfOrder turned on; see the migrate docs.

    Option: outOfOrder
    Required: No
    Default: false
    Description: Allows migrations to be run "out of order". 
    If you already have versions 1 and 3 applied, and now a version 2 is found, it will be applied too instead of being ignored.
    

    If you're running via the command line then do the following:

    1. Add new migration as V1.1__description.sql or similar
    2. Run flyway again with -outOfOrder true