<?xml version="1.0" encoding="UTF-8"?>
<!-- 
/*
 * MODX CMS and PHP Application Framework ("MODX")
 * Copyright 2006, 2007, 2008 by MODX, LLC.
 * All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation; either version 2 of the License, or (at your option) any later
 * version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 * Place, Suite 330, Boston, MA 02111-1307 USA
 */
 -->
<!-- The following xPDO model represents an object-relational map structure of MODX -->
<model package="modx" baseClass="xPDOObject" platform="mysql" defaultEngine="MyISAM" phpdoc-package="modx" phpdoc-subpackage="" version="1.1">
    <object class="modAccess" extends="xPDOSimpleObject">
        <field key="target" dbtype="varchar" precision="100" phptype="string" null="false" default="" index="fk" />
        <field key="principal_class" dbtype="varchar" precision="100" phptype="string" null="false" default="modPrincipal" index="index" />
        <field key="principal" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="0" index="fk" />
        <field key="authority" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="9999" index="index" />
        <field key="policy" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="0" index="fk" />

        <index alias="target" name="target" primary="false" unique="false" type="BTREE">
            <column key="target" length="" collation="A" null="false" />
        </index>
        <index alias="principal_class" name="principal_class" primary="false" unique="false" type="BTREE">
            <column key="principal_class" length="" collation="A" null="false" />
        </index>
        <index alias="principal" name="principal" primary="false" unique="false" type="BTREE">
            <column key="principal" length="" collation="A" null="false" />
        </index>
        <index alias="authority" name="authority" primary="false" unique="false" type="BTREE">
            <column key="authority" length="" collation="A" null="false" />
        </index>
        <index alias="policy" name="policy" primary="false" unique="false" type="BTREE">
            <column key="policy" length="" collation="A" null="false" />
        </index>

        <aggregate alias="Policy" class="modAccessPolicy" local="policy" foreign="id" owner="foreign" cardinality="one" />
        <aggregate alias="Principal" class="modPrincipal" local="principal" foreign="id" owner="foreign" cardinality="one" />
    </object>
    
    <object class="modAccessAction" table="access_actions" extends="modAccess">
        <aggregate alias="Target" class="modAction" local="target" foreign="id" owner="foreign" cardinality="one" />
    </object>
    
    <object class="modAccessActionDom" table="access_actiondom" extends="modAccess">
        <aggregate alias="Target" class="modActionDom" local="target" foreign="id" owner="foreign" cardinality="one" />
    </object>
    
    <object class="modAccessCategory" table="access_category" extends="modAccess">
        <field key="context_key" dbtype="varchar" precision="100" phptype="string" null="false" default="" index="fk" />

        <index alias="context_key" name="context_key" primary="false" unique="false" type="BTREE">
            <column key="context_key" length="" collation="A" null="false" />
        </index>
        
        <aggregate alias="Target" class="modCategory" local="target" foreign="id" owner="foreign" cardinality="one" />
        <aggregate alias="Context" class="modContext" local="context_key" foreign="key" cardinality="one" owner="foreign" />
    </object>

    <object class="modAccessContext" table="access_context" extends="modAccess">
        <aggregate alias="Target" class="modContext" local="target" foreign="key" owner="foreign" cardinality="one" />
    </object>

    <object class="modAccessElement" table="access_elements" extends="modAccess">
        <field key="context_key" dbtype="varchar" precision="100" phptype="string" null="false" default="" index="fk" />

        <index alias="context_key" name="context_key" primary="false" unique="false" type="BTREE">
            <column key="context_key" length="" collation="A" null="false" />
        </index>

        <aggregate alias="Target" class="modElement" local="target" foreign="id" owner="foreign" cardinality="one" />
        <aggregate alias="Context" class="modContext" local="context_key" foreign="key" cardinality="one" owner="foreign" />
    </object>
    
    <object class="modAccessTemplateVar" table="access_templatevars" extends="modAccessElement">
        <aggregate alias="Target" class="modTemplateVar" local="target" foreign="id" owner="foreign" cardinality="one" />
    </object>
    
    <object class="modAccessibleObject" extends="xPDOObject" />
    
    <object class="modAccessibleSimpleObject" extends="modAccessibleObject">
        <field key="id" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" index="pk" generated="native" />

        <index alias="PRIMARY" name="PRIMARY" primary="true" unique="true" type="BTREE">
            <column key="id" length="" collation="A" null="false" />
        </index>
    </object>
    
    <object class="modAccessMenu" table="access_menus" extends="modAccess">
        <aggregate alias="Target" class="modMenu" local="target" foreign="text" owner="foreign" cardinality="one" />
    </object>
    
    <object class="modAccessPolicy" table="access_policies" extends="xPDOSimpleObject">
        <field key="name" dbtype="varchar" precision="255" phptype="string" null="false" index="unique" />
        <field key="description" dbtype="mediumtext" phptype="string" />
        <field key="parent" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="0" index="index" />
        <field key="template" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="0" index="index" />
        <field key="class" dbtype="varchar" precision="255" phptype="string" null="false" default="" index="index" />
        <field key="data" dbtype="text" phptype="json" default="{}" />
        <field key="lexicon" dbtype="varchar" precision="255" phptype="string" null="false" default="permissions" />

        <index alias="name" name="name" primary="false" unique="true" type="BTREE">
            <column key="name" length="" collation="A" null="false" />
        </index>
        <index alias="parent" name="parent" primary="false" unique="false" type="BTREE">
            <column key="parent" length="" collation="A" null="false" />
        </index>
        <index alias="class" name="class" primary="false" unique="false" type="BTREE">
            <column key="class" length="" collation="A" null="false" />
        </index>
        <index alias="template" name="template" primary="false" unique="false" type="BTREE">
            <column key="template" length="" collation="A" null="false" />
        </index>

        <aggregate alias="Parent" class="modAccessPolicy" local="parent" foreign="id" owner="foreign" cardinality="one" />
        <aggregate alias="Template" class="modAccessPolicyTemplate" local="template" foreign="id" owner="foreign" cardinality="one" />
        <composite alias="Children" class="modAccessPolicy" local="id" foreign="parent" owner="local" cardinality="many" />
    </object>

    <object class="modAccessPolicyTemplate" table="access_policy_templates" extends="xPDOSimpleObject">
        <field key="template_group" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="0" index="index" />
        <field key="name" dbtype="varchar" precision="255" phptype="string" null="false" default="" index="index" />
        <field key="description" dbtype="mediumtext" phptype="string" />
        <field key="lexicon" dbtype="varchar" precision="255" phptype="string" null="false" default="permissions" />

        <aggregate alias="TemplateGroup" class="modAccessPolicyTemplateGroup" local="template_group" foreign="id" owner="foreign" cardinality="one" />
        <composite alias="Permissions" class="modAccessPermission" local="id" foreign="template" owner="local" cardinality="many" />
        <composite alias="Policies" class="modAccessPolicy" local="id" foreign="template" owner="local" cardinality="many" />
    </object>
    
    <object class="modAccessPolicyTemplateGroup" table="access_policy_template_groups" extends="xPDOSimpleObject">
        <field key="name" dbtype="varchar" precision="255" phptype="string" null="false" default="" index="index" />
        <field key="description" dbtype="mediumtext" phptype="string" />

        <composite alias="Templates" class="modAccessPolicyTemplate" local="id" foreign="template_group" owner="local" cardinality="many" />
    </object>

    <object class="modAccessPermission" table="access_permissions" extends="xPDOSimpleObject">
        <field key="template" dbtype="int" precision="10" phptype="integer" attributes="unsigned" null="false" default="0" index="index" />
        <field key="name" dbtype="varchar" precision="255" phptype="string" null="false" default="" index="index" />
        <field key="description" dbtype="text" phptype="string" null="false" default="" />
        <field key="value" dbtype="tinyint" precision="1" phptype="boolean" attributes="unsigned" null="false" default="1" />
        
        <index alias="template" name="template" primary="false" unique="false" type="BTREE">
            <column key="template" length="" collation="A" null="false" />
        </index>
        <index alias="name" name="name" primary="false" unique="false" type="BTREE">
            <column key="name" length="" collation="A" null="false" />
        </index>

        <aggregate alias="Template" class="modAccessPolicyTemplate" local="template" foreign="id" cardinality="one" owner="foreign" />
    </object>
    
    <object class="modAccessResource" table="access_resources" extends="modAccess">
        <field key="context_key" dbtype="varchar" precision="100" phptype="string" null="false" default="" index="fk" />
        
        <index alias="context_key" name="context_key" primary="false" unique="false" type="BTREE">
            <column key="context_key" length="" collation="A" null="false" />
        </index>

        <aggregate alias="Target" class="modResource" local="target" foreign="id" owner="foreign" cardinality="one" />
        <aggregate alias="Context" class="modContext" local="context_key" foreign="key" cardinality="one" owner="foreign" />
    </object>
    
    <object class="modAccessResourceGroup" table="access_resource_groups" extends="modAccess">
        <field key="context_key" dbtype="varchar" precision="100" phptype="string" null="false" default="" index="fk" />
        
        <index alias="context_key" name="context_key" primary="false" unique="false" type="BTREE">
            <column key="context_key" length="" collation="A" null="false" />
        </index>

        <aggregate alias="Target" class="modResourceGroup" local="target" foreign="id" owner="foreign" cardinality="one" />
        <aggregate alias="Context" class="modContext" local="context_key" foreign="key" cardinality="one" owner="foreign" />
    </object>
    
    <object class="modAction" table="actions" extends="modAccessibleSimpleObject">
        <field key="namespace" dbtype="varchar" precision="100" phptype="string" null="false" default="core" index="index" />
        <field key="parent" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="0" index="index" />
        <field key="controller" dbtype="varchar" precision="255" phptype="string" null="false" index="index" />
        <field key="haslayout" dbtype="tinyint" precision="1" attributes="unsigned" phptype="integer" null="false" default="1" />
        <field key="lang_topics" dbtype="text" phptype="string" null="false" />
        <field key="assets" dbtype="text" phptype="string" null="false" default="" />
        <field key="help_url" dbtype="text" phptype="string" null="false" default="" />

        <index alias="namespace" name="namespace" primary="false" unique="false" type="BTREE">
            <column key="namespace" length="" collation="A" null="false" />
        </index>
        <index alias="parent" name="parent" primary="false" unique="false" type="BTREE">
            <column key="parent" length="" collation="A" null="false" />
        </index>
        <index alias="controller" name="controller" primary="false" unique="false" type="BTREE">
            <column key="controller" length="" collation="A" null="false" />
        </index>

        <aggregate alias="Namespace" class="modNamespace" local="namespace" foreign="name" owner="foreign" cardinality="one" />
        <aggregate alias="Parent" class="modAction" local="parent" foreign="id" owner="foreign" cardinality="one" />
        <aggregate alias="Children" class="modAction" local="id" foreign="parent" owner="local" cardinality="many" />
        <composite alias="Menus" class="modMenu" local="id" foreign="action" owner="local" cardinality="many" />
        <composite alias="Acls" class="modAccessAction" local="id" foreign="target" owner="local" cardinality="many" />
        <composite alias="Fields" class="modActionField" local="id" foreign="action" owner="local" cardinality="many" />
    </object>
    
    <object class="modActiveUser" table="active_users" extends="xPDOObject">
        <field key="internalKey" dbtype="int" precision="9" phptype="integer" null="false" default="0" index="pk" />
        <field key="username" dbtype="varchar" precision="50" phptype="string" null="false" default="" />
        <field key="lasthit" dbtype="int" precision="20" phptype="timestamp" null="false" default="0" />
        <field key="id" dbtype="int" precision="10" phptype="integer" null="true" />
        <field key="action" dbtype="varchar" precision="255" phptype="string" null="false" default="" />
        <field key="ip" dbtype="varchar" precision="20" phptype="string" null="false" default="" />

        <index alias="internalKey" name="internalKey" primary="true" unique="true" type="BTREE">
            <column key="internalKey" length="" collation="A" null="false" />
        </index>

        <aggregate alias="User" class="modUser" local="internalKey" foreign="id" cardinality="one" owner="foreign" />
    </object>
    
    <object class="modCategory" table="categories" extends="modAccessibleSimpleObject">
        <field key="parent" dbtype="int" precision="10" phptype="integer" attributes="unsigned" default="0" index="index" />
        <field key="category" dbtype="varchar" precision="45" phptype="string" null="false" default="" index="unique" />

        <index alias="parent" name="parent" primary="false" unique="false" type="BTREE">
            <column key="parent" length="" collation="A" null="false" />
        </index>
        <index alias="category" name="category" primary="false" unique="true" type="BTREE">
            <column key="category" length="" collation="A" null="false" />
        </index>
        
        <composite alias="Children" class="modCategory" local="id" foreign="parent" cardinality="many" owner="local" />
        <aggregate alias="Parent" class="modCategory" local="parent" foreign="id" cardinality="one" owner="foreign" />
        
        <aggregate alias="Chunks" class="modChunk" key="id" local="id" foreign="category" cardinality="many" owner="local" />
        <aggregate alias="Snippets" class="modSnippet" local="id" foreign="category" cardinality="many" owner="local" />
        <aggregate alias="Plugins" class="modPlugin" local="id" foreign="category" cardinality="many" owner="local" />
        <aggregate alias="Templates" class="modTemplate" local="id" foreign="category" cardinality="many" owner="local" />
        <aggregate alias="TemplateVars" class="modTemplateVar" local="id" foreign="category" cardinality="many" owner="local" />
        <aggregate alias="PropertySets" class="modPropertySet" local="id" foreign="category" cardinality="many" owner="local" />
        <composite alias="Acls" class="modAccessCategory" local="id" foreign="target" owner="local" cardinality="many" />

        <composite alias="Ancestors" class="modCategoryClosure" local="id" foreign="ancestor" cardinality="many" owner="local" />
        <composite alias="Descendants" class="modCategoryClosure" local="id" foreign="descendant" cardinality="many" owner="local" />

        <!-- LEGACY RELATIONSHIPS : PLEASE USE ABOVE -->
        <aggregate alias="modChunk" class="modChunk" key="id" local="id" foreign="category" cardinality="many" owner="local" />
        <aggregate alias="modSnippet" class="modSnippet" local="id" foreign="category" cardinality="many" owner="local" />
        <aggregate alias="modPlugin" class="modPlugin" local="id" foreign="category" cardinality="many" owner="local" />
        <aggregate alias="modTemplate" class="modTemplate" local="id" foreign="category" cardinality="many" owner="local" />
        <aggregate alias="modTemplateVar" class="modTemplateVar" local="id" foreign="category" cardinality="many" owner="local" />
        <aggregate alias="modPropertySet" class="modPropertySet" local="id" foreign="category" cardinality="many" owner="local" />
        <!-- END LEGACY -->
        <validation>
            <rule field="category" name="preventBlank" type="xPDOValidationRule" rule="xPDOMinLengthValidationRule" value="1" message="category_err_ns_name" />
        </validation>
    </object>

    <object class="modCategoryClosure" table="categories_closure" extends="xPDOObject">
        <field key="ancestor" dbtype="int" precision="10" phptype="integer" attributes="unsigned" null="false" default="0" index="pk" />
        <field key="descendant" dbtype="int" precision="10" phptype="integer" attributes="unsigned" null="false" default="0" index="pk" />
        <field key="depth" dbtype="int" precision="10" phptype="integer" attributes="unsigned" null="false" default="0" />

        <index alias="PRIMARY" name="PRIMARY" primary="true" unique="true" type="BTREE">
            <column key="ancestor" length="" collation="A" null="false" />
            <column key="descendant" length="" collation="A" null="false" />
        </index>

        <aggregate alias="Ancestor" class="modCategory" local="ancestor" foreign="id" cardinality="one" owner="foreign" />
        <aggregate alias="Descendant" class="modCategory" local="descendant" foreign="id" cardinality="one" owner="foreign" />
    </object>

    <object class="modChunk" table="site_htmlsnippets" extends="modElement">
        <field key="name" dbtype="varchar" precision="50" phptype="string" null="false" default="" index="unique" />
        <field key="description" dbtype="varchar" precision="255" phptype="string" null="false" default="Chunk" />
        <field key="editor_type" dbtype="int" precision="11" phptype="integer" null="false" default="0" />
        <field key="category" dbtype="int" precision="11" phptype="integer" null="false" default="0" index="fk" />
        <field key="cache_type" dbtype="tinyint" precision="1" phptype="integer" null="false" default="0" />
        <field key="snippet" dbtype="mediumtext" phptype="string" />
        <field key="locked" dbtype="tinyint" precision="1" attributes="unsigned" phptype="boolean" null="false" default="0" index="index" />
        <field key="properties" dbtype="text" phptype="array" null="true" />
        
        <index alias="name" name="name" primary="false" unique="true" type="BTREE">
            <column key="name" length="" collation="A" null="false" />
        </index>
        <index alias="category" name="category" primary="false" unique="false" type="BTREE">
            <column key="category" length="" collation="A" null="false" />
        </index>
        <index alias="locked" name="locked" primary="false" unique="false" type="BTREE">
            <column key="locked" length="" collation="A" null="false" />
        </index>

        <aggregate alias="Category" class="modCategory" key="id" local="category" foreign="id" cardinality="one" owner="foreign" />
        <validation>
            <rule field="name" name="invalid" type="preg_match" rule="/^(?!\s)[a-zA-Z0-9\x2d-\x2f\x7f-\xff_-\s]+(?!\s)$/" message="chunk_err_invalid_name" />
        </validation>
    </object>

    <object class="modClassMap" table="class_map" extends="xPDOSimpleObject">
        <field key="class" dbtype="varchar" precision="120" phptype="string" null="false" default="" index="unique" />
        <field key="parent_class" dbtype="varchar" precision="120" phptype="string" null="false" default="" index="index" />
        <field key="name_field" dbtype="varchar" precision="255" phptype="string" null="false" default="name" index="index" />
        <field key="path" dbtype="tinytext" phptype="string" default="" />
        <field key="lexicon" dbtype="varchar" precision="255" phptype="string" null="false" default="core:resource" />

        <index alias="class" name="class" primary="false" unique="true" type="BTREE">
            <column key="class" length="" collation="A" null="false" />
        </index>
        <index alias="parent_class" name="parent_class" primary="false" unique="false" type="BTREE">
            <column key="parent_class" length="" collation="A" null="false" />
        </index>
        <index alias="name_field" name="name_field" primary="false" unique="false" type="BTREE">
            <column key="name_field" length="" collation="A" null="false" />
        </index>
    </object>
    
    <object class="modContentType" table="content_type" extends="xPDOSimpleObject">
        <field key="name" dbtype="varchar" precision="255" phptype="string" null="false" index="unique" />
        <field key="description" dbtype="tinytext" phptype="string" null="true" />
        <field key="mime_type" dbtype="tinytext" phptype="string" />
        <field key="file_extensions" dbtype="tinytext" phptype="string" />
        <field key="headers" dbtype="mediumtext" phptype="array" />
        <field key="binary" dbtype="tinyint" precision="1" attributes="unsigned" phptype="boolean" null="false" default="0" />
        
        <index alias="name" name="name" primary="false" unique="true" type="BTREE">
            <column key="name" length="" collation="A" null="false" />
        </index>

        <aggregate alias="Resources" class="modResource" local="id" foreign="content_type" owner="local" cardinality="many" />
        <validation>
            <rule field="name" name="name" type="xPDOValidationRule" rule="xPDOMinLengthValidationRule" value="1" message="content_type_err_ns_name" />            
        </validation>
    </object>
    
    <object class="modContext" table="context" extends="modAccessibleObject">
        <field key="key" dbtype="varchar" precision="100" phptype="string" null="false" index="pk" />
        <field key="description" dbtype="tinytext" phptype="string" />
        
        <index alias="PRIMARY" name="PRIMARY" primary="true" unique="true" type="BTREE">
            <column key="key" length="" collation="A" null="false" />
        </index>

        <composite alias="ContextResources" class="modContextResource" local="key" foreign="context_key" cardinality="many" owner="local" />
        <composite alias="ContextSettings" class="modContextSetting" local="key" foreign="context_key" cardinality="many" owner="local" />
        <composite alias="Acls" class="modAccessContext" local="key" foreign="target" owner="local" cardinality="many" />
        <validation>
            <rule field="key" name="key" type="preg_match" rule="/^[a-zA-Z\x7f-\xff][a-zA-Z0-9\x2d-\x2f\x7f-\xff]*$/" message="context_err_ns_key" />
        </validation>
    </object>

    <object class="modContextSetting" table="context_setting" extends="xPDOObject">
        <field key="context_key" dbtype="varchar" precision="255" phptype="string" null="false" index="pk" />
        <field key="key" dbtype="varchar" precision="50" phptype="string" null="false" index="pk" />
        <field key="value" dbtype="mediumtext" phptype="string" />
        <field key="xtype" dbtype="varchar" precision="75" phptype="string" null="false" default="textfield" />
        <field key="namespace" dbtype="varchar" precision="40" phptype="string" null="false" default="core" />
        <field key="area" dbtype="varchar" precision="255" phptype="string" null="false" default="" />
        <field key="editedon" dbtype="timestamp" phptype="timestamp" null="false" attributes="ON UPDATE CURRENT_TIMESTAMP" />

        <index alias="PRIMARY" name="PRIMARY" primary="true" unique="true">
            <column key="context_key" collation="A" null="false" />
            <column key="key" collation="A" null="false" />
        </index>

        <aggregate alias="Context" class="modContext" key="context_key" local="context_key" foreign="key" cardinality="one" owner="foreign" />
        <aggregate alias="SystemSetting" class="modSystemSetting" key="key" local="key" foreign="key" cardinality="one" owner="foreign" />
    </object>
    
    <object class="modContextResource" table="context_resource" extends="xPDOObject">
        <field key="context_key" dbtype="varchar" precision="255" phptype="string" null="false" index="pk" />
        <field key="resource" dbtype="int" precision="11" attributes="unsigned" phptype="string" null="false" index="pk" />
        
        <index alias="PRIMARY" name="PRIMARY" primary="true" unique="true">
            <column key="context_key" collation="A" null="false" />
            <column key="resource" collation="A" null="false" />
        </index>

        <aggregate alias="Context" class="modContext" local="context_key" foreign="key" cardinality="one" owner="foreign" />
        <aggregate alias="Resource" class="modResource" local="resource" foreign="id" cardinality="one" owner="foreign" />
    </object>
    
    <object class="modDocument" extends="modResource" />
    
    <object class="modElement" table="site_element" extends="modAccessibleSimpleObject">
        <aggregate alias="PropertySets" class="modElementPropertySet" local="id" foreign="element" owner="local" cardinality="many" />
        <composite alias="Acls" class="modAccessElement" local="id" foreign="target" owner="local" cardinality="many" />
        <aggregate alias="CategoryAcls" class="modAccessCategory" local="category" foreign="target" owner="local" cardinality="many" />
    </object>
    
    <object class="modElementPropertySet" table="element_property_sets" extends="xPDOObject">
        <field key="element" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="0" index="pk" />
        <field key="element_class" dbtype="varchar" precision="100" phptype="string" null="false" default="" index="pk" />
        <field key="property_set" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="0" index="pk" />
        
        <index alias="PRIMARY" name="PRIMARY" primary="true" unique="true">
            <column key="element" collation="A" null="false" />
            <column key="element_class" collation="A" null="false" />
            <column key="property_set" collation="A" null="false" />
        </index>

        <aggregate alias="Element" class="modElement" local="element" foreign="id" owner="foreign" cardinality="one" />
        <aggregate alias="PropertySet" class="modPropertySet" local="property_set" foreign="id" owner="foreign" cardinality="one" />
    </object>
    
    <object class="modEvent" table="system_eventnames" extends="xPDOObject">
        <field key="name" dbtype="varchar" precision="50" phptype="string" null="false" index="pk" />
        <field key="service" dbtype="tinyint" precision="4" attributes="unsigned" phptype="integer" null="false" default="0" />
        <field key="groupname" dbtype="varchar" precision="20" phptype="string" null="false" default="" />
        
        <index alias="PRIMARY" name="PRIMARY" primary="true" unique="true" type="BTREE">
            <column key="name" length="" collation="A" null="false" />
        </index>

        <aggregate alias="PluginEvents" class="modPluginEvent" local="name" foreign="event" cardinality="many" owner="local" />
    </object>

    <object class="modActionDom" table="actiondom" extends="modAccessibleSimpleObject">
        <field key="set" dbtype="int" precision="11" phptype="integer" null="false" default="0" index="index" />
        <field key="action" dbtype="int" precision="11" phptype="integer" null="false" default="0" index="index" />
        <field key="name" dbtype="varchar" precision="255" phptype="string" null="false" default="" index="index" />
        <field key="description" dbtype="text" phptype="string" />
        <field key="xtype" dbtype="varchar" precision="100" phptype="string" null="false" default="" /><!-- deprecated -->
        <field key="container" dbtype="varchar" precision="255" phptype="string" null="false" default="" />
        <field key="rule" dbtype="varchar" precision="100" phptype="string" null="false" default="" />
        <field key="value" dbtype="text" phptype="string" null="false" default="" />
        <field key="constraint" dbtype="varchar" precision="255" phptype="string" null="false" default="" /><!-- deprecated -->
        <field key="constraint_field" dbtype="varchar" precision="100" phptype="string" null="false" default="" /><!-- deprecated -->
        <field key="constraint_class" dbtype="varchar" precision="100" phptype="string" null="false" default="" /><!-- deprecated -->
        <field key="active" dbtype="tinyint" precision="1" attributes="unsigned" phptype="boolean" null="false" default="1" index="index" /><!-- deprecated -->
        <field key="for_parent" dbtype="tinyint" precision="1" attributes="unsigned" phptype="boolean" null="false" default="0" index="index" />
        <field key="rank" dbtype="int" precision="11" phptype="integer" null="false" default="0" index="index" />

        <index alias="set" name="set" primary="false" unique="false" type="BTREE">
            <column key="set" length="" collation="A" null="false" />
        </index>
        <index alias="action" name="action" primary="false" unique="false" type="BTREE">
            <column key="action" length="" collation="A" null="false" />
        </index>
        <index alias="name" name="name" primary="false" unique="false" type="BTREE">
            <column key="name" length="" collation="A" null="false" />
        </index>
        <index alias="active" name="active" primary="false" unique="false" type="BTREE">
            <column key="active" length="" collation="A" null="false" />
        </index>
        <index alias="for_parent" name="for_parent" primary="false" unique="false" type="BTREE">
            <column key="for_parent" length="" collation="A" null="false" />
        </index>
        <index alias="rank" name="rank" primary="false" unique="false" type="BTREE">
            <column key="rank" length="" collation="A" null="false" />
        </index>

        <aggregate alias="FCSet" class="modFormCustomizationSet" local="set" foreign="id" cardinality="one" owner="foreign" />
        <aggregate alias="Action" class="modAction" local="action" foreign="id" cardinality="one" owner="foreign" />
        <composite alias="Access" class="modAccessActionDom" local="id" foreign="target" cardinality="many" owner="local" />
    </object>

    <object class="modFormCustomizationProfileUserGroup" table="fc_profiles_usergroups" extends="xPDOObject">
        <field key="usergroup" dbtype="int" precision="11" phptype="integer" null="false" default="0" index="pk" />
        <field key="profile" dbtype="int" precision="11" phptype="integer" null="false" default="0" index="pk" />

        <index alias="PRIMARY" name="PRIMARY" primary="true" unique="true" type="BTREE">
            <column key="usergroup" length="" collation="A" null="false" />
            <column key="profile" length="" collation="A" null="false" />
        </index>

        <aggregate alias="UserGroup" class="modUserGroup" local="usergroup" foreign="id" cardinality="one" owner="foreign" />
        <aggregate alias="Profile" class="modFormCustomizationProfile" local="profile" foreign="id" cardinality="one" owner="foreign" />
    </object>
    <object class="modFormCustomizationProfile" table="fc_profiles" extends="xPDOSimpleObject">
        <field key="name" dbtype="varchar" precision="255" phptype="string" null="false" default="" index="index" />
        <field key="description" dbtype="text" phptype="string" null="false" default="" />
        <field key="active" dbtype="tinyint" precision="1" phptype="integer" null="false" default="0" index="index" />
        <field key="rank" dbtype="int" precision="11" phptype="integer" null="false" default="0" index="index" />

        <index alias="name" name="name" primary="false" unique="false" type="BTREE">
            <column key="name" length="" collation="A" null="false" />
        </index>
        <index alias="rank" name="rank" primary="false" unique="false" type="BTREE">
            <column key="rank" length="" collation="A" null="false" />
        </index>
        <index alias="active" name="active" primary="false" unique="false" type="BTREE">
            <column key="active" length="" collation="A" null="false" />
        </index>

        <composite alias="Sets" class="modFormCustomizationSet" local="id" foreign="profile" cardinality="many" owner="local" />
        <composite alias="UserGroups" class="modFormCustomizationProfileUserGroup" local="id" foreign="profile" cardinality="many" owner="local" />
    </object>

    <object class="modFormCustomizationSet" table="fc_sets" extends="xPDOSimpleObject">
        <field key="profile" dbtype="integer" precision="11" phptype="integer" null="false" default="0" index="index" />
        <field key="action" dbtype="integer" precision="11" phptype="integer" null="false" default="0" index="index" />
        <field key="description" dbtype="text" phptype="string" null="false" default="" />
        <field key="active" dbtype="tinyint" precision="1" phptype="integer" null="false" default="0" index="index" />
        <field key="template" dbtype="integer" precision="11" phptype="integer" null="false" default="0" index="index" />
        <field key="constraint" dbtype="varchar" precision="255" phptype="string" null="false" default="" />
        <field key="constraint_field" dbtype="varchar" precision="100" phptype="string" null="false" default="" />
        <field key="constraint_class" dbtype="varchar" precision="100" phptype="string" null="false" default="" />

        <index alias="profile" name="profile" primary="false" unique="false" type="BTREE">
            <column key="profile" length="" collation="A" null="false" />
        </index>
        <index alias="action" name="action" primary="false" unique="false" type="BTREE">
            <column key="action" length="" collation="A" null="false" />
        </index>
        <index alias="active" name="active" primary="false" unique="false" type="BTREE">
            <column key="active" length="" collation="A" null="false" />
        </index>
        <index alias="template" name="template" primary="false" unique="false" type="BTREE">
            <column key="template" length="" collation="A" null="false" />
        </index>

        <aggregate alias="Action" class="modAction" local="action" foreign="id" cardinality="one" owner="foreign" />
        <aggregate alias="Template" class="modTemplate" local="template" foreign="id" cardinality="one" owner="foreign" />
        <aggregate alias="Profile" class="modFormCustomizationProfile" local="profile" foreign="id" cardinality="one" owner="foreign" />
        <composite alias="Rules" class="modActionDom" local="id" foreign="set" cardinality="many" owner="local" />
    </object>

    <object class="modActionField" table="actions_fields" extends="xPDOSimpleObject">
        <field key="action" dbtype="integer" precision="11" phptype="integer" null="false" default="0" index="index" />
        <field key="name" dbtype="varchar" precision="255" phptype="string" null="false" default="" /> <!-- name/id of field -->
        <field key="type" dbtype="varchar" precision="100" phptype="string" null="false" default="field" index="index" /> <!-- either field/tab -->
        <field key="tab" dbtype="varchar" precision="255" phptype="string" null="false" default="" index="index" /> <!-- for fields, what tab they are on -->
        <field key="form" dbtype="varchar" precision="255" phptype="string" null="false" default="" /> <!-- the form ID (for dom sel purposes) -->
        <field key="other" dbtype="varchar" precision="255" phptype="string" null="false" default="" /> <!-- used on tabs to delineate TV tabs -->
        <field key="rank" dbtype="integer" precision="11" phptype="integer" null="false" default="0" />

        <index alias="action" name="action" primary="false" unique="false" type="BTREE">
            <column key="action" length="" collation="A" null="false" />
        </index>
        <index alias="type" name="type" primary="false" unique="false" type="BTREE">
            <column key="type" length="" collation="A" null="false" />
        </index>
        <index alias="tab" name="tab" primary="false" unique="false" type="BTREE">
            <column key="tab" length="" collation="A" null="false" />
        </index>
        
        <aggregate alias="Action" class="modAction" local="action" foreign="id" cardinality="one" owner="foreign" />
    </object>

    <object class="modJSONRPCResource" extends="modXMLRPCResource" />
    
    <object class="modLexiconEntry" table="lexicon_entries" extends="xPDOSimpleObject">
        <field key="name" dbtype="varchar" precision="255" phptype="string" null="false" default="" index="index" />
        <field key="value" dbtype="text" phptype="string" null="false" default="" />
        <field key="topic" dbtype="varchar" precision="255" phptype="string" null="false" default="default" index="index" />
        <field key="namespace" dbtype="varchar" precision="40" phptype="string" null="false" default="core" index="index" />
        <field key="language" dbtype="varchar" precision="20" phptype="string" null="false" default="en" index="index" />
        <field key="createdon" dbtype="datetime" phptype="datetime" />
        <field key="editedon" dbtype="timestamp" phptype="timestamp" null="false" attributes="ON UPDATE CURRENT_TIMESTAMP" />
        
        <index alias="name" name="name" primary="false" unique="false" type="BTREE">
            <column key="name" length="" collation="A" null="false" />
        </index>
        <index alias="topic" name="topic" primary="false" unique="false" type="BTREE">
            <column key="topic" length="" collation="A" null="false" />
        </index>
        <index alias="namespace" name="namespace" primary="false" unique="false" type="BTREE">
            <column key="namespace" length="" collation="A" null="false" />
        </index>
        <index alias="language" name="language" primary="false" unique="false" type="BTREE">
            <column key="language" length="" collation="A" null="false" />
        </index>

        <aggregate alias="Namespace" class="modNamespace" local="namespace" foreign="name" cardinality="one" owner="foreign" />
    </object>
    
    <object class="modManagerLog" table="manager_log" extends="xPDOSimpleObject">
        <field key="user" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="0" />
        <field key="occurred" dbtype="datetime" phptype="datetime" null="true" default="0000-00-00 00:00:00" />
        <field key="action" dbtype="varchar" precision="100" phptype="string" null="false" default="" />
        <field key="classKey" dbtype="varchar" precision="100" phptype="string" null="false" default="" />
        <field key="item" dbtype="varchar" precision="255" phptype="string" null="false" default="0" />

        <aggregate alias="User" class="modUser" local="user" foreign="id" owner="foreign" cardinality="one" />
    </object>
    
    <object class="modMenu" table="menus" extends="modAccessibleObject">
        <field key="text" dbtype="varchar" precision="255" phptype="string" null="false" default="" index="pk" />
        <field key="parent" dbtype="varchar" precision="255" phptype="string" null="false" default="" index="index" />
        <field key="action" dbtype="int" precision="11" attributes="unsigned" phptype="integer" null="false" default="0" index="index" />
        <field key="description" dbtype="varchar" precision="255" phptype="string" null="false" default="" />
        <field key="icon" dbtype="varchar" precision="255" phptype="string" null="false" default="" />
        <field key="menuindex" dbtype="int" precision="11" attributes="unsigned" phptype="integer" null="false" default="0" />
        <field key="params" dbtype="text" phptype="string" null="false" default="" />
        <field key="handler" dbtype="text" phptype="string" null="false" default="" />
        <field key="permissions" dbtype="text" phptype="string" null="false" default="" />
        
        <index alias="PRIMARY" name="PRIMARY" primary="true" unique="true" type="BTREE">
            <column key="text" length="" collation="A" null="false" />
        </index>
        <index alias="parent" name="parent" primary="false" unique="false" type="BTREE">
            <column key="parent" length="" collation="A" null="false" />
        </index>
        <index alias="action" name="action" primary="false" unique="false" type="BTREE">
            <column key="action" length="" collation="A" null="false" />
        </index>

        <aggregate alias="Action" class="modAction" local="action" foreign="id" owner="foreign" cardinality="one" />
        <aggregate alias="Parent" class="modMenu" local="parent" foreign="text" owner="foreign" cardinality="one" />
        <aggregate alias="Children" class="modMenu" local="text" foreign="parent" owner="local" cardinality="many" />
        <composite alias="Acls" class="modAccessMenu" local="text" foreign="target" owner="local" cardinality="many" />
    </object>
    
    <object class="modNamespace" table="namespaces" extends="xPDOObject">
        <field key="name" dbtype="varchar" precision="40" phptype="string" null="false" default="" index="pk" />
        <field key="path" dbtype="text" phptype="string" default="" />
        
        <index alias="PRIMARY" name="PRIMARY" primary="true" unique="true" type="BTREE">
            <column key="name" length="" collation="A" null="false" />
        </index>

        <composite alias="LexiconEntries" class="modLexiconEntry" local="name" foreign="namespace" cardinality="many" owner="local" />
        <composite alias="SystemSettings" class="modSystemSetting" local="name" foreign="namespace" cardinality="many" owner="local" />
        <composite alias="ContextSettings" class="modContextSetting" local="name" foreign="namespace" cardinality="many" owner="local" />
        <composite alias="UserSettings" class="modUserSetting" local="name" foreign="namespace" cardinality="many" owner="local" />
        <composite alias="Actions" class="modAction" local="name" foreign="namespace" cardinality="many" owner="local" />
    </object>
    
    <object class="modPlugin" table="site_plugins" extends="modScript">
        <field key="cache_type" dbtype="tinyint" precision="1" phptype="integer" null="false" default="0" />
        <field key="plugincode" dbtype="mediumtext" phptype="string" null="false" default="" />
        <field key="locked" dbtype="tinyint" precision="1" attributes="unsigned" phptype="boolean" null="false" default="0" index="index" />
        <field key="properties" dbtype="text" phptype="array" null="true" />
        <field key="disabled" dbtype="tinyint" precision="1" attributes="unsigned" phptype="boolean" null="false" default="0" index="index" />
        <field key="moduleguid" dbtype="varchar" precision="32" phptype="string" null="false" default="" index="fk" />

        <index alias="locked" name="locked" primary="false" unique="false" type="BTREE">
            <column key="locked" length="" collation="A" null="false" />
        </index>
        <index alias="disabled" name="disabled" primary="false" unique="false" type="BTREE">
            <column key="disabled" length="" collation="A" null="false" />
        </index>

        <composite alias="PluginEvents" class="modPluginEvent" local="id" foreign="pluginid" cardinality="many" owner="local" />
        <validation>
            <rule field="name" name="invalid" type="preg_match" rule="/^(?!\s)[a-zA-Z0-9_-\x7f-\xff\s]+(?!\s)$/" message="plugin_err_invalid_name" />
        </validation>
    </object>
    
    <object class="modPluginEvent" table="site_plugin_events" extends="xPDOObject">
        <field key="pluginid" dbtype="int" precision="10" phptype="integer" null="false" default="0" index="pk" />
        <field key="event" dbtype="varchar" precision="255" phptype="string" null="false" default="" index="pk" />
        <field key="priority" dbtype="int" precision="10" phptype="integer" null="false" default="0" index="index" />
        <field key="propertyset" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="0" index="index" />
        
        <index alias="PRIMARY" name="PRIMARY" primary="true" unique="true" type="BTREE">
            <column key="pluginid" length="" collation="A" null="false" />
            <column key="event" length="" collation="A" null="false" />
        </index>
        <index alias="priority" name="priority" primary="false" unique="false" type="BTREE">
            <column key="priority" length="" collation="A" null="false" />
        </index>

        <aggregate alias="Plugin" class="modPlugin" local="pluginid" foreign="id" cardinality="one" owner="foreign" />
        <aggregate alias="Event" class="modEvent" local="event" foreign="name" cardinality="one" owner="foreign" />
        <aggregate alias="PropertySet" class="modPropertySet" local="propertyset" foreign="id" cardinality="one" owner="foreign" />
    </object>
    
    <object class="modPrincipal" extends="xPDOSimpleObject">
        <composite alias="Acls" class="modAccess" local="id" foreign="principal" cardinality="many" owner="local" />
    </object>
    
    <object class="modPropertySet" table="property_set" extends="xPDOSimpleObject">
        <field key="name" dbtype="varchar" precision="50" phptype="string" null="false" default="" index="unique" />
        <field key="category" dbtype="int" precision="10" phptype="integer" null="false" default="0" index="fk" />
        <field key="description" dbtype="varchar" precision="255" phptype="string" null="false" default="" />
        <field key="properties" dbtype="text" phptype="array" null="true" />
    
        <index alias="name" name="name" primary="false" unique="true" type="BTREE">
            <column key="name" length="" collation="A" null="false" />
        </index>
        <index alias="category" name="category" primary="false" unique="false" type="BTREE">
            <column key="category" length="" collation="A" null="false" />
        </index>

        <aggregate alias="Category" class="modCategory" key="id" local="category" foreign="id" cardinality="one" owner="foreign" />
        <composite alias="Elements" class="modElementPropertySet" local="id" foreign="property_set" cardinality="many" owner="local" />        
    </object>
    
    <object class="modResource" table="site_content" extends="modAccessibleSimpleObject">
        <field key="type" dbtype="varchar" precision="20" phptype="string" null="false" default="document" />
        <field key="contentType" dbtype="varchar" precision="50" phptype="string" null="false" default="text/html" />
        <field key="pagetitle" dbtype="varchar" precision="255" phptype="string" null="false" default="" index="fulltext" indexgrp="content_ft_idx" />
        <field key="longtitle" dbtype="varchar" precision="255" phptype="string" null="false" default="" index="fulltext" indexgrp="content_ft_idx" />
        <field key="description" dbtype="varchar" precision="255" phptype="string" null="false" default="" index="fulltext" indexgrp="content_ft_idx" />
        <field key="alias" dbtype="varchar" precision="255" phptype="string" null="true" default="" index="index" />
        <field key="link_attributes" dbtype="varchar" precision="255" phptype="string" null="false" default="" />
        <field key="published" dbtype="tinyint" precision="1" attributes="unsigned" phptype="boolean" null="false" default="0" index="index" />
        <field key="pub_date" dbtype="int" precision="20" phptype="timestamp" null="false" default="0" index="index" />
        <field key="unpub_date" dbtype="int" precision="20" phptype="timestamp" null="false" default="0" index="index" />
        <field key="parent" dbtype="int" precision="10" phptype="integer" null="false" default="0" index="index" />
        <field key="isfolder" dbtype="tinyint" precision="1" attributes="unsigned" phptype="boolean" null="false" default="0" index="index" />
        <field key="introtext" dbtype="text" phptype="string" index="fulltext" indexgrp="content_ft_idx" />
        <field key="content" dbtype="mediumtext" phptype="string" index="fulltext" indexgrp="content_ft_idx" />
        <field key="richtext" dbtype="tinyint" precision="1" attributes="unsigned" phptype="boolean" null="false" default="1" />
        <field key="template" dbtype="int" precision="10" phptype="integer" null="false" default="0" index="index" />
        <field key="menuindex" dbtype="int" precision="10" phptype="integer" null="false" default="0" index="index" />
        <field key="searchable" dbtype="tinyint" precision="1" attributes="unsigned" phptype="boolean" null="false" default="1" index="index" />
        <field key="cacheable" dbtype="tinyint" precision="1" attributes="unsigned" phptype="boolean" null="false" default="1" index="index" />
        <field key="createdby" dbtype="int" precision="10" phptype="integer" null="false" default="0" />
        <field key="createdon" dbtype="int" precision="20" phptype="timestamp" null="false" default="0" />
        <field key="editedby" dbtype="int" precision="10" phptype="integer" null="false" default="0" />
        <field key="editedon" dbtype="int" precision="20" phptype="timestamp" null="false" default="0" />
        <field key="deleted" dbtype="tinyint" precision="1" attributes="unsigned" phptype="boolean" null="false" default="0" />
        <field key="deletedon" dbtype="int" precision="20" phptype="timestamp" null="false" default="0" />
        <field key="deletedby" dbtype="int" precision="10" phptype="integer" null="false" default="0" />
        <field key="publishedon" dbtype="int" precision="20" phptype="timestamp" null="false" default="0" />
        <field key="publishedby" dbtype="int" precision="10" phptype="integer" null="false" default="0" />
        <field key="menutitle" dbtype="varchar" precision="255" phptype="string" null="false" default="" />
        <field key="donthit" dbtype="tinyint" precision="1" attributes="unsigned" phptype="boolean" null="false" default="0" />
        <field key="privateweb" dbtype="tinyint" precision="1" attributes="unsigned" phptype="boolean" null="false" default="0" />
        <field key="privatemgr" dbtype="tinyint" precision="1" attributes="unsigned" phptype="boolean" null="false" default="0" />
        <field key="content_dispo" dbtype="tinyint" precision="1" phptype="integer" null="false" default="0" />
        <field key="hidemenu" dbtype="tinyint" precision="1" attributes="unsigned" phptype="boolean" null="false" default="0" index="index" />
        <field key="class_key" dbtype="varchar" precision="100" phptype="string" null="false" default="modDocument" index="index" />
        <field key="context_key" dbtype="varchar" precision="100" phptype="string" null="false" default="web" index="index" />
        <field key="content_type" dbtype="int" precision="11" attributes="unsigned" phptype="integer" null="false" default="1" />
        <field key="uri" dbtype="text" phptype="string" null="true" index="index" />
        <field key="uri_override" dbtype="tinyint" precision="1" phptype="integer" null="false" default="0" index="index" />
        
        <index alias="alias" name="alias" primary="false" unique="false" type="BTREE">
            <column key="alias" length="" collation="A" null="true" />
        </index>
        <index alias="published" name="published" primary="false" unique="false" type="BTREE">
            <column key="published" length="" collation="A" null="false" />
        </index>
        <index alias="pub_date" name="pub_date" primary="false" unique="false" type="BTREE">
            <column key="pub_date" length="" collation="A" null="false" />
        </index>
        <index alias="unpub_date" name="unpub_date" primary="false" unique="false" type="BTREE">
            <column key="unpub_date" length="" collation="A" null="false" />
        </index>
        <index alias="parent" name="parent" primary="false" unique="false" type="BTREE">
            <column key="parent" length="" collation="A" null="false" />
        </index>
        <index alias="isfolder" name="isfolder" primary="false" unique="false" type="BTREE">
            <column key="isfolder" length="" collation="A" null="false" />
        </index>
        <index alias="template" name="template" primary="false" unique="false" type="BTREE">
            <column key="template" length="" collation="A" null="false" />
        </index>
        <index alias="menuindex" name="menuindex" primary="false" unique="false" type="BTREE">
            <column key="menuindex" length="" collation="A" null="false" />
        </index>
        <index alias="searchable" name="searchable" primary="false" unique="false" type="BTREE">
            <column key="searchable" length="" collation="A" null="false" />
        </index>
        <index alias="cacheable" name="cacheable" primary="false" unique="false" type="BTREE">
            <column key="cacheable" length="" collation="A" null="false" />
        </index>
        <index alias="hidemenu" name="hidemenu" primary="false" unique="false" type="BTREE">
            <column key="hidemenu" length="" collation="A" null="false" />
        </index>
        <index alias="class_key" name="class_key" primary="false" unique="false" type="BTREE">
            <column key="class_key" length="" collation="A" null="false" />
        </index>
        <index alias="context_key" name="context_key" primary="false" unique="false" type="BTREE">
            <column key="context_key" length="" collation="A" null="false" />
        </index>
        <index alias="uri" name="uri" primary="false" unique="false" type="BTREE">
            <column key="uri" length="1000" collation="A" null="true" />
        </index>
        <index alias="uri_override" name="uri_override" primary="false" unique="false" type="BTREE">
            <column key="uri_override" length="" collation="A" null="false" />
        </index>
        <index alias="content_ft_idx" name="content_ft_idx" primary="false" unique="false" type="FULLTEXT">
            <column key="pagetitle" length="" collation="A" null="false" />
            <column key="longtitle" length="" collation="A" null="false" />
            <column key="description" length="" collation="A" null="false" />
            <column key="introtext" length="" collation="A" null="true" />
            <column key="content" length="" collation="A" null="true" />
        </index>

        <aggregate alias="Parent" class="modResource" local="parent" foreign="id" cardinality="one" owner="foreign" />
        <aggregate alias="Children" class="modResource" local="id" foreign="parent" cardinality="many" owner="local" />
        <aggregate alias="CreatedBy" class="modUser" local="createdby" foreign="id" cardinality="one" owner="foreign" />
        <aggregate alias="EditedBy" class="modUser" local="editedby" foreign="id" cardinality="one" owner="foreign" />
        <aggregate alias="DeletedBy" class="modUser" local="deletedby" foreign="id" cardinality="one" owner="foreign" />
        <aggregate alias="PublishedBy" class="modUser" local="publishedby" foreign="id" cardinality="one" owner="foreign" />
        <aggregate alias="Template" class="modTemplate" local="template" foreign="id" cardinality="one" owner="foreign" />
        <aggregate alias="TemplateVars" class="modTemplateVar" local="id:template" foreign="contentid:templateid" cardinality="many" owner="local" />
        <aggregate alias="TemplateVarTemplates" class="modTemplateVarTemplate" local="template" foreign="templateid" cardinality="many" owner="local" />
        <aggregate alias="ContentType" class="modContentType" local="content_type" foreign="id" owner="foreign" cardinality="one" />
        <aggregate alias="Context" class="modContext" local="context_key" foreign="key" owner="foreign" cardinality="one" />
        <composite alias="TemplateVarResources" class="modTemplateVarResource" local="id" foreign="contentid" cardinality="many" owner="local" />
        <composite alias="ResourceGroupResources" class="modResourceGroupResource" local="id" foreign="document" cardinality="many" owner="local" />
        <composite alias="Acls" class="modAccessResource" local="id" foreign="target" owner="local" cardinality="many" />
        <composite alias="ContextResources" class="modContextResource" local="id" foreign="resource" cardinality="many" owner="local" />
    </object>
    
    <object class="modResourceGroup" table="documentgroup_names" extends="modAccessibleSimpleObject">
        <field key="name" dbtype="varchar" precision="255" phptype="string" null="false" default="" index="unique" />
        <field key="private_memgroup" dbtype="tinyint" precision="1" attributes="unsigned" phptype="boolean" null="false" default="0" />
        <field key="private_webgroup" dbtype="tinyint" precision="1" attributes="unsigned" phptype="boolean" null="false" default="0" />

        <index alias="name" name="name" primary="false" unique="true" type="BTREE">
            <column key="name" length="" collation="A" null="false" />
        </index>

        <composite alias="ResourceGroupResources" class="modResourceGroupResource" local="id" foreign="document_group" cardinality="many" owner="local" />
        <composite alias="Acls" class="modAccessResourceGroup" local="id" foreign="target" owner="local" cardinality="many" />
    </object>
    
    <object class="modResourceGroupResource" table="document_groups" extends="xPDOSimpleObject">
        <field key="document_group" dbtype="int" precision="10" phptype="integer" null="false" default="0" index="index" />
        <field key="document" dbtype="int" precision="10" phptype="integer" null="false" default="0" index="index" />
        
        <index alias="document_group" name="document_group" primary="false" unique="false" type="BTREE">
            <column key="document_group" length="" collation="A" null="false" />
        </index>
        <index alias="document" name="document" primary="false" unique="false" type="BTREE">
            <column key="document" length="" collation="A" null="false" />
        </index>

        <aggregate alias="ResourceGroup" class="modResourceGroup" key="id" local="document_group" foreign="id" cardinality="one" owner="foreign" />
        <aggregate alias="Resource" class="modResource" key="id" local="document" foreign="id" cardinality="one" owner="foreign" />
    </object>
    
    <object class="modScript" table="site_script" extends="modElement">
        <field key="name" dbtype="varchar" precision="50" phptype="string" null="false" default="" index="unique" />
        <field key="description" dbtype="varchar" precision="255" phptype="string" null="false" default="" />
        <field key="editor_type" dbtype="int" precision="11" phptype="integer" null="false" default="0" />
        <field key="category" dbtype="int" precision="11" phptype="integer" null="false" default="0" index="fk" />
    
        <index alias="name" name="name" primary="false" unique="true" type="BTREE">
            <column key="name" length="" collation="A" null="false" />
        </index>
        <index alias="category" name="category" primary="false" unique="false" type="BTREE">
            <column key="category" length="" collation="A" null="false" />
        </index>

        <aggregate alias="Category" class="modCategory" key="id" local="category" foreign="id" cardinality="one" owner="foreign" />
    </object>
    
    <object class="modSession" table="session" extends="xPDOObject">
        <field key="id" dbtype="varchar" precision="40" phptype="string" null="false" index="pk" default="" />
        <field key="access" dbtype="int" precision="20" phptype="timestamp" null="true" attributes="unsigned" />
        <field key="data" dbtype="mediumtext" phptype="string" />

        <index alias="PRIMARY" name="PRIMARY" primary="true" unique="true" type="BTREE">
            <column key="id" length="" collation="A" null="false" />
        </index>
    </object>
    
    <object class="modSnippet" table="site_snippets" extends="modScript">
        <field key="cache_type" dbtype="tinyint" precision="1" phptype="integer" null="false" default="0" />
        <field key="snippet" dbtype="mediumtext" phptype="string" />
        <field key="locked" dbtype="tinyint" precision="1" attributes="unsigned" phptype="boolean" null="false" default="0" index="index" />
        <field key="properties" dbtype="text" phptype="array" null="true" />
        <field key="moduleguid" dbtype="varchar" precision="32" phptype="string" null="false" default="" index="fk" />

        <index alias="locked" name="locked" primary="false" unique="false" type="BTREE">
            <column key="locked" length="" collation="A" null="false" />
        </index>
        <index alias="moduleguid" name="moduleguid" primary="false" unique="false" type="BTREE">
            <column key="moduleguid" length="" collation="A" null="false" />
        </index>

        <validation>
            <rule field="name" name="invalid" type="preg_match" rule="/^(?!\s)[a-zA-Z0-9\x2d-\x2f\x7f-\xff_-\s]+(?!\s)$/" message="snippet_err_invalid_name" />
        </validation>
    </object>
    
    <object class="modStaticResource" extends="modResource" />
    
    <object class="modSymLink" extends="modResource" />
    
    <object class="modSystemSetting" table="system_settings" extends="xPDOObject">
        <field key="key" dbtype="varchar" precision="50" phptype="string" null="false" default="" index="pk" />
        <field key="value" dbtype="text" phptype="string" null="false" default="" />
        <field key="xtype" dbtype="varchar" precision="75" phptype="string" null="false" default="textfield" />
        <field key="namespace" dbtype="varchar" precision="40" phptype="string" null="false" default="core" />
        <field key="area" dbtype="varchar" precision="255" phptype="string" null="false" default="" />
        <field key="editedon" dbtype="timestamp" phptype="timestamp" null="false" attributes="ON UPDATE CURRENT_TIMESTAMP" />
        
        <index alias="PRIMARY" name="PRIMARY" primary="true" unique="true" type="BTREE">
            <column key="key" length="" collation="A" null="false" />
        </index>

        <aggregate alias="ContextSetting" class="modContextSetting" local="key" foreign="key" cardinality="one" owner="local" />
        <aggregate alias="Namespace" class="modNamespace" local="namespace" foreign="name" cardinality="one" owner="foreign" />
    </object>
    
    <object class="modTemplate" table="site_templates" extends="modElement">
        <field key="templatename" dbtype="varchar" precision="50" phptype="string" null="false" default="" index="unique" />
        <field key="description" dbtype="varchar" precision="255" phptype="string" null="false" default="Template" />
        <field key="editor_type" dbtype="int" precision="11" phptype="integer" null="false" default="0" />
        <field key="category" dbtype="int" precision="11" phptype="integer" null="false" default="0" index="fk" />
        <field key="icon" dbtype="varchar" precision="255" phptype="string" null="false" default="" />
        <field key="template_type" dbtype="int" precision="11" phptype="integer" null="false" default="0" />
        <field key="content" dbtype="mediumtext" phptype="string" null="false" default="" />
        <field key="locked" dbtype="tinyint" precision="1" attributes="unsigned" phptype="boolean" null="false" default="0" index="index" />
        <field key="properties" dbtype="text" phptype="array" null="true" />
        
        <index alias="templatename" name="templatename" primary="false" unique="true" type="BTREE">
            <column key="templatename" length="" collation="A" null="false" />
        </index>
        <index alias="category" name="category" primary="false" unique="false" type="BTREE">
            <column key="category" length="" collation="A" null="false" />
        </index>
        <index alias="locked" name="locked" primary="false" unique="false" type="BTREE">
            <column key="locked" length="" collation="A" null="false" />
        </index>

        <aggregate alias="Category" class="modCategory" local="category" foreign="id" cardinality="one" owner="foreign" />
        <aggregate alias="Resources" class="modResource" local="id" foreign="template" cardinality="many" owner="local" />
        <composite alias="TemplateVarTemplates" class="modTemplateVarTemplate" local="id" foreign="templateid" cardinality="many" owner="local" />
    </object>
    
    <object class="modTemplateVar" table="site_tmplvars" extends="modElement">
        <field key="type" dbtype="varchar" precision="20" phptype="string" null="false" default="" />
        <field key="name" dbtype="varchar" precision="50" phptype="string" null="false" default="" index="unique" />
        <field key="caption" dbtype="varchar" precision="80" phptype="string" null="false" default="" />
        <field key="description" dbtype="varchar" precision="255" phptype="string" null="false" default="" />
        <field key="editor_type" dbtype="int" precision="11" phptype="integer" null="false" default="0" />
        <field key="category" dbtype="int" precision="11" phptype="integer" null="false" default="0" index="fk" />
        <field key="locked" dbtype="tinyint" precision="1" attributes="unsigned" phptype="boolean" null="false" default="0" index="index" />
        <field key="elements" dbtype="text" phptype="string" />
        <field key="rank" dbtype="int" precision="11" phptype="integer" null="false" default="0" index="index" />
        <field key="display" dbtype="varchar" precision="20" phptype="string" null="false" default="" />
        <field key="default_text" dbtype="text" phptype="string" />
        <field key="properties" dbtype="text" phptype="array" null="true" />
        <field key="input_properties" dbtype="text" phptype="array" null="true" />
        <field key="output_properties" dbtype="text" phptype="array" null="true" />
        
        <index alias="name" name="name" primary="false" unique="true" type="BTREE">
            <column key="name" length="" collation="A" null="false" />
        </index>
        <index alias="category" name="category" primary="false" unique="false" type="BTREE">
            <column key="category" length="" collation="A" null="false" />
        </index>
        <index alias="locked" name="locked" primary="false" unique="false" type="BTREE">
            <column key="locked" length="" collation="A" null="false" />
        </index>
        <index alias="rank" name="rank" primary="false" unique="false" type="BTREE">
            <column key="rank" length="" collation="A" null="false" />
        </index>

        <aggregate alias="Category" class="modCategory" local="category" foreign="id" cardinality="one" owner="foreign" />
        <composite alias="TemplateVarTemplates" class="modTemplateVarTemplate" local="id" foreign="tmplvarid" cardinality="many" owner="local" />
        <composite alias="TemplateVarResources" class="modTemplateVarResource" local="id" foreign="tmplvarid" cardinality="many" owner="local" />
        <composite alias="TemplateVarResourceGroups" class="modTemplateVarResourceGroup" local="id" foreign="tmplvarid" cardinality="many" owner="local" />
        <validation>
            <rule field="name" name="invalid" type="preg_match" rule="/^(?!\s)[a-zA-Z0-9\x2d-\x2f\x7f-\xff_-\s]+(?!\s)$/" message="tv_err_invalid_name" />
            <rule field="name" name="reserved" type="preg_match" rule="/(?!^(id|type|contentType|pagetitle|longtitle|description|alias|link_attributes|published|pub_date|unpub_date|parent|isfolder|introtext|content|richtext|template|menuindex|searchable|cacheable|createdby|createdon|editedby|editedon|deleted|deletedby|deletedon|publishedon|publishedby|menutitle|donthit|privateweb|privatemgr|content_dispo|hidemenu|class_key|context_key|content_type)$)/" message="tv_err_reserved_name" />
        </validation>
    </object>
    
    <object class="modTemplateVarResource" table="site_tmplvar_contentvalues" extends="xPDOSimpleObject">
        <field key="tmplvarid" dbtype="int" precision="10" phptype="integer" null="false" default="0" index="index" />
        <field key="contentid" dbtype="int" precision="10" phptype="integer" null="false" default="0" index="index" />
        <field key="value" dbtype="text" phptype="string" null="false" />

        <index alias="tmplvarid" name="tmplvarid" primary="false" unique="false" type="BTREE">
            <column key="tmplvarid" length="" collation="A" null="false" />
        </index>
        <index alias="contentid" name="contentid" primary="false" unique="false" type="BTREE">
            <column key="contentid" length="" collation="A" null="false" />
        </index>

        <aggregate alias="TemplateVar" class="modTemplateVar" local="tmplvarid" foreign="id" cardinality="one" owner="foreign" />
        <aggregate alias="Resource" class="modResource" local="contentid" foreign="id" cardinality="one" owner="foreign" />
    </object>
    
    <object class="modTemplateVarResourceGroup" table="site_tmplvar_access" extends="xPDOSimpleObject">
        <field key="tmplvarid" dbtype="int" precision="10" phptype="integer" null="false" default="0" />
        <field key="documentgroup" dbtype="int" precision="10" phptype="integer" null="false" default="0" />
        
        <aggregate alias="TemplateVar" class="modTemplateVar" local="tmplvarid" foreign="id" cardinality="one" owner="foreign" />
        <aggregate alias="ResourceGroup" class="modResourceGroup" local="documentgroup" foreign="id" cardinality="one" owner="foreign" />
    </object>
    
    <object class="modTemplateVarTemplate" table="site_tmplvar_templates" extends="xPDOObject">
        <field key="tmplvarid" dbtype="int" precision="10" phptype="integer" null="false" default="0" index="pk" />
        <field key="templateid" dbtype="int" precision="11" phptype="integer" null="false" default="0" index="pk" />
        <field key="rank" dbtype="int" precision="11" phptype="integer" null="false" default="0" />
        
        <index alias="PRIMARY" name="PRIMARY" primary="true" unique="true" type="BTREE">
            <column key="tmplvarid" length="" collation="A" null="false" />
            <column key="templateid" length="" collation="A" null="false" />
        </index>

        <aggregate alias="TemplateVar" class="modTemplateVar" key="id" local="tmplvarid" foreign="id" cardinality="one" owner="foreign" />
        <aggregate alias="Template" class="modTemplate" key="id" local="templateid" foreign="id" cardinality="one" owner="foreign" />
    </object>
    
    <object class="modUser" table="users" extends="modPrincipal">
        <field key="username" dbtype="varchar" precision="100" phptype="string" null="false" default="" index="unique" />
        <field key="password" dbtype="varchar" precision="100" phptype="string" null="false" default="" />
        <field key="cachepwd" dbtype="varchar" precision="100" phptype="string" null="false" default="" />
        <field key="class_key" dbtype="varchar" precision="100" phptype="string" null="false" default="modUser" index="index" />
        <field key="active" dbtype="tinyint" precision="1" phptype="boolean" attributes="unsigned" null="false" default="1" />
        <field key="remote_key" dbtype="varchar" precision="255" phptype="string" null="true" index="index" />
        <field key="remote_data" dbtype="text" phptype="json" null="true" />
        <field key="hash_class" dbtype="varchar" precision="100" phptype="string" null="false" default="hashing.modPBKDF2" />
        <field key="salt" dbtype="varchar" precision="100" phptype="string" null="false" default="" />

        <index alias="username" name="username" primary="false" unique="true" type="BTREE">
            <column key="username" length="" collation="A" null="false" />
        </index>
        <index alias="class_key" name="class_key" primary="false" unique="false" type="BTREE">
            <column key="class_key" length="" collation="A" null="false" />
        </index>
        <index alias="remote_key" name="remote_key" primary="false" unique="false" type="BTREE">
            <column key="remote_key" length="" collation="A" null="false" />
        </index>

        <aggregate alias="CreatedResources" class="modResource" local="id" foreign="createdby" cardinality="many" owner="local" />
        <aggregate alias="EditedResources" class="modResource" local="id" foreign="editedby" cardinality="many" owner="local" />
        <aggregate alias="DeletedResources" class="modResource" local="id" foreign="deletedby" cardinality="many" owner="local" />
        <aggregate alias="PublishedResources" class="modResource" local="id" foreign="publishedby" cardinality="many" owner="local" />
        <aggregate alias="SentMessages" class="modUserMessage" local="id" foreign="sender" cardinality="many" owner="local" />
        <aggregate alias="ReceivedMessages" class="modUserMessage" local="id" foreign="recipient" cardinality="many" owner="local" />
        <composite alias="Profile" class="modUserProfile" local="id" foreign="internalKey" cardinality="one" owner="local" />
        <composite alias="UserSettings" class="modUserSetting" local="id" foreign="user" cardinality="many" owner="local" />
        <composite alias="UserGroupMembers" class="modUserGroupMember" local="id" foreign="member" cardinality="many" owner="local" />
    </object>
    
    <object class="modUserGroup" table="membergroup_names" extends="modPrincipal">
        <field key="name" dbtype="varchar" precision="255" phptype="string" null="false" default="" index="unique" />
        <field key="description" dbtype="text" phptype="string" />
        <field key="parent" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="0" index="index" />
        <field key="rank" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="0" index="index" />
        
        <index alias="name" name="name" primary="false" unique="true" type="BTREE">
            <column key="name" length="" collation="A" null="false" />
        </index>
        <index alias="parent" name="parent" primary="false" unique="false" type="BTREE">
            <column key="parent" length="" collation="A" null="false" />
        </index>
        <index alias="rank" name="rank" primary="false" unique="false" type="BTREE">
            <column key="rank" length="" collation="A" null="false" />
        </index>

        <aggregate alias="Parent" class="modUserGroup" local="parent" foreign="id" cardinality="one" owner="foreign" />
        <aggregate alias="Children" class="modUserGroup" local="id" foreign="parent" cardinality="many" owner="local" />
        <composite alias="UserGroupMembers" class="modUserGroupMember" local="id" foreign="user_group" cardinality="many" owner="local" />
        <composite alias="FormCustomizationProfiles" class="modFormCustomizationProfileUserGroup" local="id" foreign="usergroup" cardinality="many" owner="local" />
    </object>
    
    <object class="modUserGroupMember" table="member_groups" extends="xPDOSimpleObject">
        <field key="user_group" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="0" />
        <field key="member" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="0" />
        <field key="role" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="1" index="index" />
        <field key="rank" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="0" index="index" />
        
        <index alias="role" name="role" primary="false" unique="false" type="BTREE">
            <column key="role" length="" collation="A" null="false" />
        </index>
        <index alias="rank" name="rank" primary="false" unique="false" type="BTREE">
            <column key="rank" length="" collation="A" null="false" />
        </index>

        <aggregate alias="UserGroupRole" class="modUserGroupRole" local="role" foreign="id" cardinality="one" owner="foreign" />
        <aggregate alias="UserGroup" class="modUserGroup" local="user_group" foreign="id" cardinality="one" owner="foreign" />
        <aggregate alias="User" class="modUser" local="member" foreign="id" cardinality="one" owner="foreign" />
    </object>
    
    <object class="modUserGroupRole" table="user_group_roles" extends="xPDOSimpleObject">
        <field key="name" dbtype="varchar" precision="255" phptype="string" null="false" index="unique" />
        <field key="description" dbtype="mediumtext" phptype="string" />
        <field key="authority" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="9999" index="index" />
        
        <index alias="name" name="name" primary="false" unique="true" type="BTREE">
            <column key="name" length="" collation="A" null="false" />
        </index>
        <index alias="authority" name="authority" primary="false" unique="false" type="BTREE">
            <column key="authority" length="" collation="A" null="false" />
        </index>

        <aggregate alias="UserGroupMembers" class="modUserGroupMember" local="id" foreign="role" cardinality="many" owner="local" />
    </object>
    
    <object class="modUserMessage" table="user_messages" extends="xPDOSimpleObject">
        <field key="type" dbtype="varchar" precision="15" phptype="string" null="false" default="" />
        <field key="subject" dbtype="varchar" precision="255" phptype="string" null="false" default="" />
        <field key="message" dbtype="text" phptype="string" null="false" default="" />
        <field key="sender" dbtype="int" precision="10" phptype="integer" null="false" default="0" />
        <field key="recipient" dbtype="int" precision="10" phptype="integer" null="false" default="0" />
        <field key="private" dbtype="tinyint" precision="4" phptype="integer" null="false" default="0" />
        <field key="date_sent" dbtype="datetime" phptype="datetime" null="false" default="0000-00-00 00:00:00" />
        <field key="read" dbtype="tinyint" precision="1" phptype="integer" null="false" default="0" />

        <aggregate alias="Sender" class="modUser" local="sender" foreign="id" cardinality="one" owner="foreign" />
        <aggregate alias="Recipient" class="modUser" local="recipient" foreign="id" cardinality="one" owner="foreign" />
    </object>
    
    <object class="modUserProfile" table="user_attributes" extends="xPDOSimpleObject">
        <field key="internalKey" dbtype="int" precision="10" phptype="integer" null="false" index="unique" />
        <field key="fullname" dbtype="varchar" precision="100" phptype="string" null="false" default="" />
        <field key="email" dbtype="varchar" precision="100" phptype="string" null="false" default="" />
        <field key="phone" dbtype="varchar" precision="100" phptype="string" null="false" default="" />
        <field key="mobilephone" dbtype="varchar" precision="100" phptype="string" null="false" default="" />
        <field key="blocked" dbtype="tinyint" precision="1" attributes="unsigned" phptype="boolean" null="false" default="0" />
        <field key="blockeduntil" dbtype="int" precision="11" phptype="integer" null="false" default="0" />
        <field key="blockedafter" dbtype="int" precision="11" phptype="integer" null="false" default="0" />
        <field key="logincount" dbtype="int" precision="11" phptype="integer" null="false" default="0" />
        <field key="lastlogin" dbtype="int" precision="11" phptype="integer" null="false" default="0" />
        <field key="thislogin" dbtype="int" precision="11" phptype="integer" null="false" default="0" />
        <field key="failedlogincount" dbtype="int" precision="10" phptype="integer" null="false" default="0" />
        <field key="sessionid" dbtype="varchar" precision="100" phptype="string" null="false" default="" />
        <field key="dob" dbtype="int" precision="10" phptype="integer" null="false" default="0" />
        <field key="gender" dbtype="int" precision="1" phptype="integer" null="false" default="0" />
        <field key="address" dbtype="text" phptype="string" null="false" default="" />
        <field key="country" dbtype="varchar" precision="255" phptype="string" null="false" default="" />
        <field key="city" dbtype="varchar" precision="255" phptype="string" null="false" default="" />
        <field key="state" dbtype="varchar" precision="25" phptype="string" null="false" default="" />
        <field key="zip" dbtype="varchar" precision="25" phptype="string" null="false" default="" />
        <field key="fax" dbtype="varchar" precision="100" phptype="string" null="false" default="" />
        <field key="photo" dbtype="varchar" precision="255" phptype="string" null="false" default="" />
        <field key="comment" dbtype="text" phptype="string" null="false" default="" />
        <field key="website" dbtype="varchar" precision="255" phptype="string" null="false" default="" />
        <field key="extended" dbtype="text" phptype="json" null="true" index="fulltext" indexgrp="extended" />
        
        <index alias="internalKey" name="internalKey" primary="false" unique="true" type="BTREE">
            <column key="internalKey" length="" collation="A" null="false" />
        </index>

        <aggregate alias="User" class="modUser" local="internalKey" foreign="id" cardinality="one" owner="foreign" />
    </object>
    
    <object class="modUserSetting" table="user_settings" extends="xPDOObject">
        <field key="user" dbtype="int" precision="11" phptype="integer" null="false" default="0" index="pk" />
        <field key="key" dbtype="varchar" precision="50" phptype="string" null="false" default="" index="pk" />
        <field key="value" dbtype="text" phptype="string" />
        <field key="xtype" dbtype="varchar" precision="75" phptype="string" null="false" default="textfield" />
        <field key="namespace" dbtype="varchar" precision="40" phptype="string" null="false" default="core" />
        <field key="area" dbtype="varchar" precision="255" phptype="string" null="false" default="" />
        <field key="editedon" dbtype="timestamp" phptype="timestamp" null="false" attributes="ON UPDATE CURRENT_TIMESTAMP" />
        
        <index alias="PRIMARY" name="PRIMARY" primary="true" unique="true" type="BTREE">
            <column key="user" length="" collation="A" null="false" />
            <column key="key" length="" collation="A" null="false" />
        </index>

        <aggregate alias="User" class="modUser" local="user" foreign="id" cardinality="one" owner="foreign" />
        <aggregate alias="Namespace" class="modNamespace" local="namespace" foreign="name" cardinality="one" owner="foreign" />
    </object>
    
    <object class="modWebLink" extends="modResource" />
    
    <object class="modWorkspace" table="workspaces" extends="xPDOSimpleObject">
        <field key="name" dbtype="varchar" precision="255" phptype="string" null="false" default="" index="index" />
        <field key="path" dbtype="varchar" precision="255" phptype="string" null="false" default="" index="unique" />
        <field key="created" dbtype="datetime" phptype="timestamp" null="false" />
        <field key="active" dbtype="tinyint" precision="1" attributes="unsigned" phptype="boolean" null="false" default="0" index="index" />
        <field key="attributes" dbtype="mediumtext" phptype="array" />
        
        <index alias="name" name="name" primary="false" unique="false" type="BTREE">
            <column key="name" length="" collation="A" null="false" />
        </index>
        <index alias="path" name="path" primary="false" unique="true" type="BTREE">
            <column key="path" length="" collation="A" null="false" />
        </index>
        <index alias="active" name="sctive" primary="false" unique="false" type="BTREE">
            <column key="active" length="" collation="A" null="false" />
        </index>

        <composite alias="Packages" class="transport.modTransportPackage" local="id" foreign="workspace" cardinality="many" owner="local" />
    </object>
    
    <object class="modXMLRPCResource" extends="modResource" />

    <!-- MOVE DEPRECATED OBJECT DEFINITIONS BELOW HERE -->
</model>
