# Extension contest: table-count-check

**URL:** <https://forum.liquibase.org/t/extension-contest-table-count-check/270>\
**Category:** General Discussion\
**Created:** [September 30, 2009, 5:04pm UTC](https://forum.liquibase.org/t/extension-contest-table-count-check/270 "2009-09-30T17:04:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cimershein](https://avatars.discourse-cdn.com/v4/letter/c/3ab097/32.png) [@cimershein](https://forum.liquibase.org/u/cimershein)\
**Post date:** [September 30, 2009, 5:04pm UTC](https://forum.liquibase.org/t/extension-contest-table-count-check/270/1 "2009-09-30T17:04:00Z")

</div>

I have checked in a partial entry for the extension contest:&nbsp; 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.

Thanks!

Chris Imershein

---

<div class="post-metadata">

**Author:** ![nvoxland](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@nvoxland](https://forum.liquibase.org/u/nvoxland)\
**Post date:** [September 30, 2009, 5:04pm UTC](https://forum.liquibase.org/t/extension-contest-table-count-check/270/2 "2009-09-30T17:04:00Z")

</div>

Sneaking it in, right before the deadline :)&nbsp;

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

Nathan

---

<div class="post-metadata">

**Author:** ![cimershein](https://avatars.discourse-cdn.com/v4/letter/c/3ab097/32.png) [@cimershein](https://forum.liquibase.org/u/cimershein)\
**Post date:** [September 30, 2009, 5:04pm UTC](https://forum.liquibase.org/t/extension-contest-table-count-check/270/3 "2009-09-30T17:04:00Z")

</div>

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

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ... &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 

&nbsp; &nbsp;   
&nbsp; &nbsp; \<xsd:group name=“PreConditionChildren”\>  
&nbsp; &nbsp; &nbsp; &nbsp; xsd:sequence  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xsd:choice  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \<xsd:element ref=“and” maxOccurs=“unbounded”/\>  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \<xsd:element ref=“or” maxOccurs=“unbounded”/\>  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; …  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \<xsd:element ref=“sqlCheck” maxOccurs=“unbounded”/\>  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \<xsd:element ref=“customPrecondition” maxOccurs=“unbounded”/\>  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \</xsd:choice\>  
&nbsp; &nbsp; &nbsp; &nbsp; \</xsd:sequence\>

This could allow easier definition and usage of custom preconditions with custom attributes.&nbsp; (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:

&nbsp; &nbsp; &nbsp;

&nbsp; &nbsp; &nbsp; &nbsp;   
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;   
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;   
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;   
&nbsp; &nbsp; &nbsp; &nbsp;

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

Chris

---

<div class="post-metadata">

**Author:** ![nvoxland](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@nvoxland](https://forum.liquibase.org/u/nvoxland)\
**Post date:** [September 30, 2009, 5:04pm UTC](https://forum.liquibase.org/t/extension-contest-table-count-check/270/4 "2009-09-30T17:04:00Z")

</div>

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

 http://www.liquibase.org/xml/ns/dbchangelog" &nbsp; &nbsp; &nbsp; &nbsp; xmlns:ext="[http://www.liquibase.org/xml/ns/dbchangelog-ext"](http://www.liquibase.org/xml/ns/dbchangelog-ext%22) &nbsp; &nbsp; &nbsp; &nbsp; xmlns:xsi="[http://www.w3.org/2001/XMLSchema-instance"](http://www.w3.org/2001/XMLSchema-instance%22) &nbsp; &nbsp; &nbsp; &nbsp; xsi:schemaLocation="[http://www.liquibase.org/xml/ns/dbchangelog](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/dbchangelog-2.0.xsd) &nbsp; &nbsp; &nbsp; &nbsp; [http://www.liquibase.org/xml/ns/dbchangelog-ext](http://www.liquibase.org/xml/ns/dbchangelog-ext)[http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd"\>](http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd%22>) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 

Does that work for you?

Nathan
