I currently have four ChangeUnits written as follows:
When I run Mongock for the first time, the mongockChangeLog collection shows four new entries indicating that all four ChangeUnits have been executed. Every subsequent time I run Mongock, I only see two new entries (for action-box-initializer and button-action initializer) that log runAlways=false scripts as "IGNORED".
I expect to see that the two runAlways=True scripts are also logged in mongockChangeLog collection as "EXECUTED" every time Mongock is run, but I do not see this. Is there a configuration option for me to change the logging behavior of runAlways=true ChangeUnits?
Edit: I believe the error is in Mongock's io.mongock.runner.core.executor.ChangeExecutorBase.class file on line 231. According to the code, it looks like the ChangeLog is only logged in the mongockChangeLog collection if it is runAlways=true
that hasn't been executed before, or it is runAlways=false
...
line 231 in question
That is the expected behavior. Mongock currently only track the first execution of every ChangeUnit.
There is no existing configuration to change that behavior.
You can check the additional executions with the output log.