medizininformatik-initiative / feasibility-backend

Backend of the feasibility-gui.
Apache License 2.0
2 stars 5 forks source link

Multiple repeatable DB migrations #312

Open michael-82 opened 4 days ago

michael-82 commented 4 days ago

Currently with only one db migration script (loading the ui profiles) it is feasible to have a script clean the db beforehand. With two seperate scripts, this is no longer an option, since flyway only executes those scripts that have changed. And if only one has changed, the data from the other would be missing.

michael-82 commented 3 days ago

I currently see no other option than including the corresponding DELETE statements to the repeatable DB dump files themselves. When trying to use callback scripts from flyway to execute, there is no way (or at least I did not find the way) to get a list of queued repeatable migrations for this run, so that you could programmatically either delete ids < 100000 or > 10000.

When simply trying to set the checksums for the already applied repeatable migrations to 0, this does not lead to both scripts being executed because apparently, the list of migrations to run is compiled before calling this script.