Is there any way to stop runAlways = true migration from running always based on some variable ? #675
-
I have a use case where I don't want to run the runAlways migration on the same application build number. There can be multiple reasons when the pod crash can happen or it was restarted. If a ChangeUnit is runAlways, I want it to be executed once only on the same application build number. This application build number is injected in the application config once it is deployed. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Beta Was this translation helpful? Give feedback.
-
Sorry @rahulsant100 , we discussed this and we thought we answered you. However, I am not 100% clear what your use case is. My understanding is that you have a changeUnit with runAlways set to Nevertheless, you have some scenarios where you don't want this behaviour. Let's imagine you have two instances of the same application you are deploying. Currently, the changeUnit will be executed twice, one per instance, but you only want the changeUnit to be run once. Or if, having only one instance, the application is restarted, then you don't want the changeUnit to be run again. Is my understanding correct, @rahulsant100 ? |
Beta Was this translation helpful? Give feedback.
I understand your point now. Unfortunately we don't have anything like that at the moment, however in the next big release, in which we are going to re-define the concept to provide what Mongock offers now, but mucho more, we will add that feature together with the concept of deployment.
In the meantime, I can think in some workarounds, not ideal, but it would work. For example, as part of your changeUnit, you could persist the app version, then that changeUnit would check if the app version(passed somehow as parameter) is different to what is persisted, in that case will run the code, other wise will pass.
Regards