Hi all,
I have a changelog which adds partitioning to an Oracle table for non-XE databases and omits it otherwise (since Oracle does not allow partitioning for dev XE databases). In order to have modifySQL.append working I need to create a "nonXE" context.
The problem: the user might forget to put any context and run it against a prod database. In that case, it will still successfully execute, but with no partitions (which is bad).
Is there a simple way to require at least one context to be set when running a Liquibase build? I created a "hook", but it is more complex than it should be, and has to be included into every top-level changelog:
- <!-- trap to set a property if no contexts set.
- Liquibase will run this nonexistent context only if no cotnexts are set.-->
- <property name="no_context" value="yes" context="no_context"/>
- <preConditions onFailMessage="Use either --contexts=xe or --contexts=nonxe" onFail="HALT">
- <not>
- <changeLogPropertyDefined property="no_context"/>
- </not>
- </preConditions>