<?xml version="1.0"?>
<schema version="0.3">

<table name="Areas">
    <field name="arID" type="I" size="10">
      <KEY/>
      <AUTOINCREMENT/>
      <UNSIGNED/>
    </field>
    <field name="cID" type="I" size="10">
      <NOTNULL/>
      <DEFAULT value="0"/>
      <UNSIGNED/>
    </field>
    <field name="arHandle" type="C" size="255">
      <NOTNULL/>
    </field>
    <field name="arOverrideCollectionPermissions" type="I1" size="1">
      <NOTNULL/>
      <DEFAULT value="0"/>
    </field>
    <field name="arInheritPermissionsFromAreaOnCID" type="I" size="10">
      <NOTNULL/>
      <DEFAULT value="0"/>
      <UNSIGNED/>
    </field>
    <field name="arIsGlobal" type="I" size="1">
      <NOTNULL/>
      <DEFAULT value="0"/>
      <UNSIGNED/>
    </field>  
    <index name="arIsGlobal">
      <col>arIsGlobal</col>
    </index>
    <index name="cID">
      <col>cID</col>
    </index>

    <index name="arHandle">
      <col>arHandle</col>
    </index>
   </table>
   

  <table name="AttributeSets">
    <field name="asID" type="I" size="10">
      <KEY/>
      <AUTOINCREMENT/>
      <UNSIGNED/>
    </field>
    <field name="asName" type="C" size="255"/>
    <field name="asHandle" type="C" size="255">
      <NOTNULL/>
    </field>
    <field name="akCategoryID" type="I" size="10">
      <NOTNULL/>
      <DEFAULT value="0"/>
      <UNSIGNED/>
    </field>
    <field name="pkgID" type="I" size="10">
      <NOTNULL/>
      <DEFAULT value="0"/>
      <UNSIGNED/>
    </field>
    <field name="asIsLocked" type="I" size="1">
      <NOTNULL/>
      <DEFAULT value="1"/>
    </field>
    <field name="asDisplayOrder" type="I" size="10">
      <NOTNULL/>
      <DEFAULT value="0"/>
      <UNSIGNED/>
    </field>
  </table>

<table name="CollectionVersionBlocks">
    <field name="cID" type="I" size="10">
      <KEY/>
      <DEFAULT value="0"/>
      <UNSIGNED/>
    </field>
    <field name="cvID" type="I" size="10">
      <KEY/>
      <DEFAULT value="1"/>
      <UNSIGNED/>
    </field>
    <field name="bID" type="I" size="10">
      <KEY/>
      <DEFAULT value="0"/>
      <UNSIGNED/>
    </field>
    <field name="arHandle" type="C" size="255">
      <KEY/>
    </field>
    <field name="cbDisplayOrder" type="I" size="10">
      <NOTNULL/>
      <DEFAULT value="0"/>
      <UNSIGNED/>
    </field>
    <field name="isOriginal" type="I1" size="1">
      <NOTNULL/>
      <DEFAULT value="0"/>
      <UNSIGNED/>
    </field>
    <field name="cbOverrideAreaPermissions" type="I1" size="1">
      <NOTNULL/>
      <DEFAULT value="0"/>
    </field>
    <field name="cbIncludeAll" type="I1" size="1">
      <NOTNULL/>
      <DEFAULT value="0"/>
    </field>
    <index name="cbIncludeAll">
      <col>cbIncludeAll</col>
    </index>
    <index name="isOriginal">
      <col>isOriginal</col>
    </index>
    <index name="bID">
      <col>bID</col>
    </index>
    <index name="cIDcvID">
      <col>cID</col>
      <col>cvID</col>
    </index>
  </table>
 <table name="PageTypes">
    <field name="ctID" type="I" size="10">
      <KEY/>
      <AUTOINCREMENT/>
      <UNSIGNED/>
    </field>
    <field name="ctHandle" type="C" size="32">
      <NOTNULL/>
    </field>
    <field name="ctIcon" type="C" size="128"/>
    <field name="ctName" type="C" size="90">
      <NOTNULL/>
    </field>
    <field name="ctIsInternal" type="I1" size="1">
      <NOTNULL/>
      <DEFAULT value="0"/>
    </field>
    <field name="pkgID" type="I" size="10">
      <NOTNULL/>
      <DEFAULT value="0"/>
      <UNSIGNED/>
    </field>
    <index name="ctHandle">
      <UNIQUE/>
      <col>ctHandle</col>
    </index>
  </table>

 <table name="CollectionVersionRelatedEdits">
    <field name="cID" type="I" size="10">
      <KEY/>
      <DEFAULT value="0"/>
      <UNSIGNED/>
    </field>
    <field name="cvID" type="I" size="10">
      <KEY/>
      <DEFAULT value="0"/>
      <UNSIGNED/>
    </field>
    <field name="cRelationID" type="I" size="10">
      <KEY/>
      <DEFAULT value="0"/>
      <UNSIGNED/>
    </field>
    <field name="cvRelationID" type="I" size="10">
      <KEY/>
      <DEFAULT value="0"/>
      <UNSIGNED/>
    </field>
  </table>

	<table name="Stacks">
    <field name="stID" type="I" size="10">
      <KEY/>
      <AUTOINCREMENT/>
      <UNSIGNED/>
    </field>
    <field name="stName" type="C" size="255">
      <NOTNULL/>
    </field>
    <field name="stType" type="I" size="1">
      <NOTNULL/>
      <DEFAULT value="0"/>
      <UNSIGNED/>
    </field>
    <field name="cID" type="I" size="10">
      <NOTNULL/>
      <DEFAULT value="0"/>
      <UNSIGNED/>
    </field>
    <index name="stType">
      <col>stType</col>
    </index>
    <index name="stName">
      <col>stName</col>
    </index>
  </table>
	<table name="btPageList">
		<field name="bID" type="I">
			<key />
			<unsigned />
		</field>
		<field name="num" type="I2">
			<unsigned />
			<notnull />
		</field>
		<field name="orderBy" type="C" size="32">
			<descr>Was enum, display_asc','display_desc','chrono_asc','chrono_desc','alpha_asc','alpha_desc','score_asc','score_desc'</descr>
		</field>
		<field name="cParentID" type="I">
			<unsigned />
			<notnull />
			<default value="1" />
		</field>
		<field name="cThis" type="I1">
			<unsigned />
			<notnull />
			<default value="0" />
		</field>
		<field name="includeAllDescendents" type="I1">
			<unsigned />
			<notnull />
			<default value="0" />
		</field>
		<field name="paginate" type="I1">
			<unsigned />
			<notnull />
			<default value="0" />
		</field>
		<field name="displayAliases" type="I1">
			<unsigned />
			<notnull />
			<default value="1" />
		</field>
		
		<field name="ctID" type="I2">
			<unsigned />
		</field>
		<field name="rss" type="I">
			<default value="0"/>
		</field>
		<field name="rssTitle" type="C" size="255">
		</field>
		<field name="rssDescription" type="X2">
		</field>		
		<field name="truncateSummaries" type="I">
			<default value="0"/>
		</field>
		<field name="displayFeaturedOnly" type="I">
			<default value="0"/>
		</field>
		<field name="truncateChars" type="I">
			<default value="128"/>
		</field>		
	</table>

<table name="MailImporters">
    <field name="miID" type="I" size="10">
      <KEY/>
      <AUTOINCREMENT/>
      <UNSIGNED/>
    </field>
    <field name="miHandle" type="C" size="64">
      <NOTNULL/>
    </field>
    <field name="miServer" type="C" size="255"/>
    <field name="miUsername" type="C" size="255"/>
    <field name="miPassword" type="C" size="255"/>
    <field name="miEncryption" type="C" size="32"/>
    <field name="miIsEnabled" type="I" size="1">
      <NOTNULL/>
      <DEFAULT value="0"/>
    </field>
    <field name="miEmail" type="C" size="255"/>
    <field name="miPort" type="I" size="10">
      <NOTNULL/>
      <DEFAULT value="0"/>
      <UNSIGNED/>
    </field>
   <field name="pkgID" type="I" size="10">
      <UNSIGNED />
    </field>
	<field name="miConnectionMethod" type="C" size="8">
		<default value="POP" />
	</field>
  </table>

<table name="SystemAntispamLibraries">
    <field name="saslHandle" type="C" size="64">
      <KEY/>
    </field>
    <field name="saslName" type="C" size="255"/>
    <field name="saslIsActive" type="I" size="1">
      <NOTNULL/>
      <DEFAULT value="0"/>
    </field>
    <field name="pkgID" type="I" size="10">
      <NOTNULL/>
      <DEFAULT value="0"/>
      <UNSIGNED/>
    </field>
  </table>
  <table name="SystemCaptchaLibraries">
    <field name="sclHandle" type="C" size="64">
      <KEY/>
    </field>
    <field name="sclName" type="C" size="255"/>
    <field name="sclIsActive" type="I" size="1">
      <NOTNULL/>
      <DEFAULT value="0"/>
    </field>
    <field name="pkgID" type="I" size="10">
      <NOTNULL/>
      <DEFAULT value="0"/>
      <UNSIGNED/>
    </field>
  </table>	
	<table name="btFormAnswerSet">
		<field name="asID" type="I">
			<key />
			<autoincrement />
			<unsigned />
		</field>
		<field name="questionSetId" type="I">
			<unsigned />
			<default value="0" />
		</field>
		<field name="created" type="T">
			<deftimestamp />
		</field>
		<field name="uID" type="I">
			<unsigned />
			<default value="0" />
		</field>
		<index name="questionSetId">
			<col>questionSetId</col>
		</index>
	</table>
	
	<table name="btContentImage">
		<field name="bID" type="I">
			<key />
			<unsigned />
		</field>
		<field name="fID" type="I">
			<unsigned />
			<default value="0" />
		</field>
		<field name="fOnstateID" type="I">
			<unsigned />
			<default value="0" />
		</field>
		<field name="maxWidth" type="I">
			<unsigned />
			<default value="0" />
		</field>
		<field name="maxHeight" type="I">
			<unsigned />
			<default value="0" />
		</field>
		<field name="externalLink"  type="C" size="255"></field>
		<field name="internalLinkCID"  type="I">
			<unsigned />
			<default value="0" />
		</field>
		<field name="altText" type="C" size="255">
		</field>
	</table>

</schema>