Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

flyway: common script to run after every migration

I have a generic cleanup script that I'd like to run after every migration. Is there a good way to have this script run after each migration (short of including the script itself as a change every time I do a migration?)

I see that this question has been asked before here Pre- and Post-migration scripts for Flyway and the answer at that time was no, not really.

Has the answer changed at all in the past 1.5 years?

like image 711
user2009267 Avatar asked Feb 05 '13 22:02

user2009267


2 Answers

With flyway 3.0 the situation has changed and there are now callback scripts possible. In this situation an afterMigration.sql file could be used to do the cleanups.

See http://flywaydb.org/documentation/callbacks.html for more information.

like image 173
Markus Heberling Avatar answered Sep 27 '22 23:09

Markus Heberling


This has not changed. Use any of the suggested workarounds for now.

like image 27
Axel Fontaine Avatar answered Sep 28 '22 00:09

Axel Fontaine