what is database baseline version in flywaydb. Can I use it for migrating from a specific version and up?

544 views Asked by At

Is there a way to tell flyway to migrate files from a specific version and forward and to exclude the ones before?E.g I might have v1, v2, v3, v4 and v5 and my db is currently in v2. I want to apply only v4 and v5 migrations for some reasons. Is this possible with flyway?I tried

flyway.setBaselineVersionAsString("3");
flyway.migrate();

but flyway migrated both 3, 4 and 5 versions. Is it possible when metadata table exists? Or only when applying flywaydb in a existing db for the first time?

1

There are 1 answers

0
Axel Fontaine On

This is not currently supported. The only way to achieve this would be to drop the metadata table, baseline a new one at V3 and execute migrate afterwards.