Formatted SQL with prerequisites

I'm on Liquibase version: 2.0.1.

Is it possible to have prerequisites in a formatted sql file? If so, how? An example is assessment.

I would like to do something like this, but in a sql file.

<preConditions onFail="WARN"> <sqlCheck expectedResult="0">select count(*) from oldtable</sqlCheck> </preConditions> 
+4
source share
2 answers

Currently supported preconditions are supported in the sql file of a liquid-formatted file. Inside the definition of a set of parameters, preconditions can be specified in the following format (copied from official documents):

 --preconditions onFail:HALT onError:HALT --precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM my_table 

The documentation says that only the sql check precondition type is currently supported.

Full documentation is available on the Liquibase website .

+6
source

Unfortunately, the current FormattedSql parser does not support the prerequisites.

You can extend the default class with your own parser, which would support it if you need to. See http://liquibase.org/extensions

+2
source

Source: https://habr.com/ru/post/1343190/


All Articles