Update 2014-04-29: Now it is possible with Flyway 3.0 by implementing the FlywayCallback interface.
Previous answer
Short answer: no, not at this moment.
Here's why: I thought about it, and also laid the original design for Flyway. The more I thought about this aspect, the more it became clear to me that these pre and post scenarios are also an integral part of migration, or at least something that migration cannot handle if it wants to be successful. Therefore, I would recommend either:
- Combine 1, 2, and 3 in one migration
- You have 3 separate migrations x.1 (drop views), x.2 (actual migration), x.3 (rebuild)
You might even want x.1 and x.3 to call stored procedures that do the work for you to avoid code duplication between migrations if these steps are repeated.
If Flyway takes care of making all the changes in the database structure, it all becomes simpler, avoiding the combination of different technologies.
source share