Comments
1 comment
-
Hello Fredrik_S,
Thank you for the excellent question!
Firstly, an implicit behavioural element that may not be immediately obvious, if you have multiple baselines, flyway will only use the newest, this is the preferred way to handle changing requirements.
By extension, but arguably optionally, is the idea of 'rebaselining' which is to consolidate all your existing changes into a new baseline.
This can be useful when as time progresses, the sum of all your migrations accumulates technical debt over time and due to ever-changing business requirements have become bloated with changes back and forth. As a result, drawing a proverbial line in the sand and reconstituting all those changes into a single baseline which becomes your new source of truth that you operate from can be very useful.
In practical terms that means you either package up your existing migrations and remove them from Flyway Desktop, your you start a new project for the purpose of generating this baseline. The exact choice of adding this to the existing scripts, or replacing them wholesale is best done on a case by case basis, how many environments it will affect is commonly the most impactful consideration.
Lastly, a couple of clarifications on some of your points.- validateOnMigrate doesn't validate your sql code. What it does is prepend your Migrate verb with a validate verb, the purposes of which is to verify that the scripts available match the scripts that are known.
I.E A safety net to highlight if anyone snuck an alteration into a script between when it was last run and now.
- The exception you're seeing is direct from the db, not flyway and as such can't really be ignored. You could potentially suppress the error if you intend to deal with it through some other means. But I would use that approach sparingly as you could easily make a rod for your own back by continuing instead of addressing the issues.
See flyway error overrides
- validateOnMigrate doesn't validate your sql code. What it does is prepend your Migrate verb with a validate verb, the purposes of which is to verify that the scripts available match the scripts that are known.
Add comment
Please sign in to leave a comment.
Questions: