gradle flywayMigrate -DinitOnMigrate=true satisfies all 3 requirements
Gradle flyway How to figure out schema version and decide if upgrade is required or not?
Domanda
My requirement is to write a gradle task and using flyway plugin that will do the following:
- If database does not exist then execute gradle flywayInit and gradle flywayMigrate
- If database does exist but not at latest schema version then execute gradle flywayMigrate
- If database exists and at latest version, then do nothing
I am aware of the flywayInfo command but how do I use it within a gradle task to figure out what is the status of the database?
Soluzione
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow