I have a very complicated migration to perform. It can not be done with SQL, I've got to use Java. And I have treat each row individually, bulky update is not possible. To make things more complicated: one of my customers has several billions of rows in the table, other customers only a couple of hundreds. If I tried to migrate the large database table, I'll surely run into memory problems. At some point, the transaction memory runs out.
What I need is to migrate blockwise and invoke a migration step multiple times. Ideally, my JdbcMigration
implementation could return an information like "I have not finished yet, please call me once more" or "I have finished, you can proceed with the next migration step" to the flyway system. If I had this feature, I would treat for example up to 1 million entries and let flyway commit the transaction. And I would repeat this as long as there are untreated entries.
Unfortunately, the method migrate(Connection)
of JdbcMigration
has a void return type. Is there any way to give flyway such a response?
Kind regards, Christian