Usually migration script is simple like adding new column or so and if applications if deployed then everything is ok. but sometimes there is some complex logic involved that should be tested. what is the recommended approach?
Have a separate DB for testing. Migrate it as part of every build and run tests against it. You can also populate it with extra test data as you desire by including a second location for test data migrations.
Main Location:
Test data location:
You can then call flyway.clean() and flyway.migrate() in a test before asserting whether the test data got transformed correctly.
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