jeudi 24 décembre 2015

Unit testing of flyway migrations?

How do I unit test my flyway migrations?

Suppose I have the following migration scripts:

V1_init.sql
V2_add_extra_columns.sql
V3_add_extra_table.sql

I would like to have a test that starts from nothing and runs the migrations. But also a test that starts with a "filled" database on V2 state and runs the V3 migration script for example.

What would be the best way to do this? I am using Spring Boot 1.3 and using the default flyway integration (scripts are in src/main/resources/db/migration).

I did see http://ift.tt/1U6rnT9 but I am not sure how to use that to test the migration from how the db was at different points in time.

Aucun commentaire:

Enregistrer un commentaire