简体   繁体   中英

How do I write a Flyway repeatable java-based migration?

I am using Flyway to try and write a repeatable Java based migration, using my own class names. ie not follow the R__ class name pattern. My work place has a check style policy that does not allow underscores in class names.

The flyway documentation states that I can have more control over my class names by implementing MigrationInfoProvider. If I implement this interface, Flyway thinks I am doing a Versioned Migration, and I want to do a Repeatable Migration.

Any suggestions?

When implementing MigrationInfoProvider, getVersion() needs to return null.

@Override
public MigrationVersion getVersion() {
    //will act as a repeatable migration
    return null;

}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM