Reputation: 931
We've had several migrations set up that were not versioned correctly. The filenames put the version in the description so the db was always at version 0. We want to rename them, but this will cause all of the scripts to rerun.
Currently, our files are named like V__001_The_First_Migration.sql
.
We want to rename them to V001__The_First_Migration.sql
without rerunning the migration.
Is there anyway to do this?
Upvotes: 2
Views: 1561
Reputation: 344
I think in FlyWay configuration, there is one property which will help:
flyway.baselineVersion=1.0
Rename all the files or the files you want to rename and set the "baselineVersion" to the last run or latest script.
Here is more: https://flywaydb.org/documentation/commandline/baseline
https://flywaydb.org/documentation/maven/baseline
Let me know if you need more help or example.
Upvotes: 2