<p>Using Spring Boot and managing database changes by Liquibase all changes are executed on application start. This is totally fine for fast running changes.</p>
<p>Some changes, e.g. adding DB index, can run for a while. If running application on K8s it happens that liveness/readyness checks trigger an application restart. In this case Liquibase causes an end-less loop.</p>
<p>Is there a pattern how to manage long running scripts with Liquibase? Any examples?
One approach might be splitting the the changes in two groups:</p>
<ul>
<li>Execute before application start.</li>
<li>Or execute while application is already up and running.</li>
</ul>

lunanigra
<p>You can use <a href="https://www.liquibase.com/blog/using-liquibase-in-kubernetes" rel="nofollow noreferrer">init container</a> to init your database before application startup.</p>
