I am using Liquibase 3.3.5 to update my database. Having contexts is a good way to only execute certain parts of the change log. But I do not understand why all the changes are made when the context is not provided during the update. Consider the following example:
- changeset A: context = test
- changeet B: no context
- changeet C: context = prod
So,
- performing an update using context = test will execute a set of changes A + B.
- executing an update using context = prod will execute a set of changes B + C.
- performing an update without context will execute a set of changes A + B + C.
For me it makes no sense :).
I would expect that only change set B will be executed, since it does not define a specific context.
In the Liquibase context example: http://www.liquibase.org/documentation/contexts.html ("Using contexts for test data"), they say that changes to be tested using the "test" should be noted and implemented with the context provided "test" for applying test data. Fine - to make sense. But
"When the time comes to migrate your production database, do not include the test context, and your test data is not included."
So, if I did not specify a โtestโ context when performing a production update, it would also make โtestโ changes, since I did not specify a context at all.
Again, I would expect that dropping the test when performing the update would perform normal changes without test changesets.
Or am I missing something here :)?
source share