I am looking for best practices on when to use preConditions
in Liquibase changeSet
.
I understand the fact that it helps in checking the existing state of the db and then applies the change.
If I am going to use Liquibase from the beginning and all the changes will be done via Liquibase should not changeSet
be enough to check/validate the existing state? Writing preConditions
seems to me more redundant in such case. I haven't been able to find any good document on this.
In my use case I will be using Liquibase for db schema change + adding metadata in couple of tables.
I see some examples for db schema change queries like adding table, column etc where preConditions
have been used.
But not seeing much around normal insert, update, delete queries. Is it good a practice to write preConditions
for such data manipulation queries as well? Is there any good documentation on this?