Extension contest: table-count-check

I have checked in a partial entry for the extension contest:  table-count-check

Currently it adds a new tableIsEmpty precondition.

However, I have been having problems getting the XSD validation to work.

Any tips would be appreciated.


Chris Imershein

Sneaking it in, right before the deadline :) 

Nice to see, I’ll look at the XSD validation and let you know if I have any thoughts on fixing it.


What would be nice is another “any” escape clause, similar to what is in changeSetChildren:


        <xsd:group name=“PreConditionChildren”>
                    <xsd:element ref=“and” maxOccurs=“unbounded”/>
                    <xsd:element ref=“or” maxOccurs=“unbounded”/>
                    <xsd:element ref=“sqlCheck” maxOccurs=“unbounded”/>
                    <xsd:element ref=“customPrecondition” maxOccurs=“unbounded”/>

This could allow easier definition and usage of custom preconditions with custom attributes.  (But of course, it does introduces more error possibilities with the xsd any validation).

I was able to get the TableIsEmpty precondition to work with the customPrecondition syntax:



I’ll work on updating the doc and the build/test examples in the Extension Portal.


I created a -ext.xsd schema that you can use as a fallback, without making the standard xsd quite so general.  From the postgres extension example:

    http://www.liquibase.org/xml/ns/dbchangelog"         xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"         xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd         http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">                

Does that work for you?