I recently switched from an old data migration provider to span (4.1.2). In our installation, we, as usual, have several incremental scripts and scripts that are repeatable. So far, everything worked well, and I was able to recreate most of the behavior that we had before, with some improvements due to the span. However, I experience strange behavior with repetitive scenarios.
Let's imagine the following scenarios:
DELETE FROM CONFIGURATION;
INSERT INTO CONFIGURATION (KEY, VALUE) VALUES ('SAF_DELAY', '22');
it starts at creation and does what it should. Also using the checksum, an entry is created in schema_version. Now I change 22to 23and run the span: migrate again, the script runs and creates a second entry in schema_version with a new checksum. After some time, I understand that it 23’s actually bad, but I 22was right from the very beginning, so I change it.
Now flyway refuses to execute the script, again telling me that everything is updated, even if the script has changed from the previous state. I assume that he does this because he can still find the old entry in schema_version.
Obviously, this is an undesirable behavior for a repeated script, the decision point should be only the last checksum executed, and not any checksum that has ever been executed from a script. It also means that I believe the documentation means "Instead, they (re) apply every time the checksum changes ." I was looking through the configuration section of the maven plugin, but could not find anything like the solution.
Since for me it was an interruption for me, I would be happy if you could give me a hint in the right direction.