Data migrations (with Java) in addition to schema migrations?


I have used Django (Python web framework) migrations for a long time and it has supported me well in rather complex schema and data migrations. So I have a preconception/bias how a good migration tool should work. I think that this bias may actually be good for asking informed questions, but you never know :). I have also used Flyway.

I’m now considering using Liquibase in a Java project with pretty complex DB schema and one thing I cannot find is support for data migrations with code.

To clarify, I define ‘data migrations’ as migrations that change the actual data records in the database as opposed to changing the database schema that Liquibase supports very well.

In the Django migration framework and in Flyway, data migrations are written as separate migrations using Python or Java code. What makes them really powerful is access to the ORMs in the data migration code.

Is there any way to run (presumably Java) code during migrations?

If not, how should one manage data migrations?



PS. Here’s the overview of Django migrations framework: