We are using a dockerized version of Flyway Community Edition 5.2.4 to manage db changes in a production environment. The database in question only has 2 versioned migrations and 3 repeatable migrations. Our most recent release included the introduction of the repeatable migrations (before this release all we has was 1 versioned migration). I noticed that the updates that the repeatable migrations were supposed to manage were not reflected in the database. The scripts are rather simple, just insert statements to add 3 new records to a table. The flyway logs show that the repeatable migrations were applied. The flyway_schema_history table also shows they were installed. I deleted the 3 records out of the flyway_schema_history table and re-ran flyway. The second time, the logs once again reported all the migrations were applied as did the flyway_schema_history table, but in reviewing the table in question only two of the scripts appear to have run. Has anyone dealt with this before?
Asked
Active
Viewed 144 times
0
-
Hi, just checking if I'm understanding. You have a repeatable migration, a `R__whatever.sql`, which adds 3 records to a table. When you run it the first time, those records are added, correct? When you add a new version script and run flyway again, your expecting the repeatable to run again and add those 3 rows again, am I understanding correctly? – Barry Sep 09 '22 at 08:31
-
No. It never adds the 3 records. The flyway schema history table claims it did, but it did not. – alex.cook Sep 10 '22 at 14:58
-
what happens if you run manually your R__ migration script ? – ShaharT Sep 15 '22 at 22:42
-
The script runs successfully and the records are added. – alex.cook Sep 16 '22 at 23:41