Reputation: 5341
If flyway upon run will end up performing any migrations, our deployment system would like to know, as it then needs to do a different set of operations than if there are no database migrations (If there are migrations, then all servers in a cluster will be taken down, and then one server will start up and perform migrations, and then the rest of the servers will be taken up. If there are no migrations, a rolling upgrade can be performed, which is desirable.)
So, can you set up flyway as normal, and then ask it whether it will in the current state perform any migrations? I guess the concept of "dry-run" would apply here: If the dry-run shows any changes, then "yes", else "no".
Upvotes: 3
Views: 303
Reputation: 5341
Got it, so answering: Evidently Flyway.info().pending() will give the set of operations that will be run. If it is non-empty, then "yes, there are changes!".
Upvotes: 3