database - flyway 4.0 java base callback afterValidate not catching the hook -
i have both sql , java based migrations. trying use flyway callback hook else right after validation done, not catching callback. documentation, seems it's simple following.
here file structure:
-java --db ---migrations ----v1__apple <----java based --fruitshopflywaycallback.java <---- callback class -resources --migrations --- v1__orange.sql <----sql based
my callback:
public class fruitshopflywaycallback extends baseflywaycallback { @override public void aftervalidate(connection dataconnection) { system.out.println("it worksssssssss"); } }
my thought once migration done, flyway going callback method. not sure missing?
in case helpful. looking how configure flyway work java callbacks using maven. need register callback classes flyway (using flyway pure java use setcallbacks).
in maven looks this:
<plugin> <groupid>org.flywaydb</groupid> <artifactid>flyway-maven-plugin</artifactid> <version>${flyway.version}</version> <configuration> <driver>org.hsqldb.jdbcdriver</driver> <url>jdbc:hsqldb:file:${project.build.directory}/db/flyway_sample;shutdown=true</url> <user>sa</user> <callbacks> <callback>example.mycallback</callback> </callbacks> </configuration> </plugin>
Comments
Post a Comment