Fix regression bug where *.once.sql scripts never got executed
This merge request resolves a regression bug where *.once.sql
scripts would never get executed, even the first time round.
The cause of the bug was a logic error when removing an obsolete feature from the migrator tool. The tool used to have an option called backfit
, which was only needed when we first started using the migrator on the production database. The backfit command descript was Backfit migrations to a legacy database (skips all .once.sql scripts even the first time)
. The old code looked like this:
When I removed the backfit
option, I didn't properly update this logic, and so the SQL commands were always missing for *.once.scripts*
, as shown here:
I've added a test to reproduce the bug, and then fixed the logic. There was actually an integration test that would have caught this, if the test itself didn't have a mistake, so I've corrected that too. And I've added an integration test to cover re-executing altered scripts with the force
option set, showing that *.once.sql
scripts don't get re-executed.
Closes #4 (closed)