I just cannot get Java migrations get to be recognized and executed using the flyway command line tool.
What I did so far:
Executed flyway.cmd migrate => worked. DB was changed
FINE SO FAR. Works as expected. Now the problematic part:
Created a Java class in my IDE.
public class V1_2__Another_test implements JdbcMigration
{
public void migrate(Connection connection) throws Exception
{
PreparedStatement statement = connection.prepareStatement("INSERT INTO flyway_sample (name) VALUES ('My Name')");
try {
statement.execute();
} finally {
statement.close();
}
}
}
Compiled the class, put it into a jar with name V1_2__Another_test.jar
What am I missing?
What you did sounds fine. Make sure to add the package where your class resides to flyway.locations and you should be good to go.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With