Search code examples
yamlliquibasepreconditions

multiples dbms in precondition of liquibase using yaml


In precondition documentation of liquibase we can see the example below:

<preConditions>
    <dbms type="oracle" />
    <dbms type="mysql" />
</preConditions>

When try to recreate the same rule using yaml, it not works.

preConditions:
  dbms:
    type: oracle
  dbms:
    type: mysql

I also have tried something like:

preConditions:
  - dbms:
      dbms:
        type: oracle
      dbms:
        type: mysql

I know that is possible to use:

dbms:
  type: oracle, mysql

I always get an error like:

expected <block end>, but found BlockEntry
in 'reader', line X, column Y:
           - dbms:
           ^

How can I use multiple dbms in preConditions?


Solution

  • The XML formant adds in a default <or> block that YAML doesn't. So the corresponding YAML format is:

      - preConditions:
        - or:
            - dbms:
                type: oracle
            - dbms:
                type: mysql