<?xml version="1.0" encoding="UTF-8"?>
<!--
/*
 * This file is part of MODX Revolution.
 *
 * Copyright (c) MODX, LLC. All Rights Reserved.
 *
 * For complete copyright and license information, see the COPYRIGHT and LICENSE
 * files found in the top-level directory of this distribution.
 */
 -->
<!-- The following xPDO model represents an object-relational map structure of MODX -->
<model package="MODX\Revolution\" baseClass="xPDO\Om\xPDOObject" platform="mysql" defaultEngine="InnoDB" phpdoc-package="MODX\Revolution" version="3.0">
    <object class="modAccess" extends="xPDO\Om\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="MODX\Revolution\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="MODX\Revolution\modAccessPolicy" local="policy" foreign="id" owner="foreign" cardinality="one" />
        <aggregate alias="Principal" class="MODX\Revolution\modPrincipal" local="principal" foreign="id" owner="foreign" cardinality="one" />
        <aggregate alias="GroupPrincipal" class="MODX\Revolution\modUserGroup" local="principal" foreign="id" owner="foreign" cardinality="one">
            <criteria target="local"><![CDATA[
            {"principal_class":"MODX\\Revolution\\modUserGroup"}
            ]]></criteria>
        </aggregate>
        <aggregate alias="UserPrincipal" class="MODX\Revolution\modUserGroup" local="principal" foreign="id" owner="foreign" cardinality="one">
            <criteria target="local"><![CDATA[
            {"principal_class":"MODX\\Revolution\\modUser"}
            ]]></criteria>
        </aggregate>
        <aggregate alias="MinimumRole" class="MODX\Revolution\modUserGroupRole" local="authority" foreign="authority" owner="local" cardinality="one" />
    </object>

    <object class="modAccessActionDom" table="access_actiondom" extends="MODX\Revolution\modAccess">
        <aggregate alias="Target" class="MODX\Revolution\modActionDom" local="target" foreign="id" owner="foreign" cardinality="one" />
    </object>

    <object class="modAccessCategory" table="access_category" extends="MODX\Revolution\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="MODX\Revolution\modCategory" local="target" foreign="id" owner="foreign" cardinality="one" />
        <aggregate alias="Context" class="MODX\Revolution\modContext" local="context_key" foreign="key" cardinality="one" owner="foreign" />
    </object>

    <object class="modAccessNamespace" table="access_namespace" extends="MODX\Revolution\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="MODX\Revolution\modNamespace" local="target" foreign="name" owner="foreign" cardinality="one" />
        <aggregate alias="Context" class="MODX\Revolution\modContext" local="context_key" foreign="key" cardinality="one" owner="foreign" />
    </object>

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

    <object class="modAccessElement" table="access_elements" extends="MODX\Revolution\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="MODX\Revolution\modElement" local="target" foreign="id" owner="foreign" cardinality="one" />
        <aggregate alias="Context" class="MODX\Revolution\modContext" local="context_key" foreign="key" cardinality="one" owner="foreign" />
    </object>

    <object class="modAccessTemplateVar" table="access_templatevars" extends="MODX\Revolution\modAccessElement">
        <aggregate alias="Target" class="MODX\Revolution\modTemplateVar" local="target" foreign="id" owner="foreign" cardinality="one" />
    </object>

    <object class="modAccessibleObject" extends="xPDO\Om\xPDOObject" />

    <object class="modAccessibleSimpleObject" extends="MODX\Revolution\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="MODX\Revolution\modAccess">
        <aggregate alias="Target" class="MODX\Revolution\modMenu" local="target" foreign="text" owner="foreign" cardinality="one" />
    </object>

    <object class="modAccessPolicy" table="access_policies" extends="xPDO\Om\xPDOSimpleObject">
        <field key="name" dbtype="varchar" precision="191" 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="191" 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="MODX\Revolution\modAccessPolicy" local="parent" foreign="id" owner="foreign" cardinality="one" />
        <aggregate alias="Template" class="MODX\Revolution\modAccessPolicyTemplate" local="template" foreign="id" owner="foreign" cardinality="one" />
        <composite alias="Children" class="MODX\Revolution\modAccessPolicy" local="id" foreign="parent" owner="local" cardinality="many" />
    </object>

    <object class="modAccessPolicyTemplate" table="access_policy_templates" extends="xPDO\Om\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="191" 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="MODX\Revolution\modAccessPolicyTemplateGroup" local="template_group" foreign="id" owner="foreign" cardinality="one" />
        <composite alias="Permissions" class="MODX\Revolution\modAccessPermission" local="id" foreign="template" owner="local" cardinality="many" />
        <composite alias="Policies" class="MODX\Revolution\modAccessPolicy" local="id" foreign="template" owner="local" cardinality="many" />
    </object>

    <object class="modAccessPolicyTemplateGroup" table="access_policy_template_groups" extends="xPDO\Om\xPDOSimpleObject">
        <field key="name" dbtype="varchar" precision="191" phptype="string" null="false" default="" index="index" />
        <field key="description" dbtype="mediumtext" phptype="string" />

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

    <object class="modAccessPermission" table="access_permissions" extends="xPDO\Om\xPDOSimpleObject">
        <field key="template" dbtype="int" precision="10" phptype="integer" attributes="unsigned" null="false" default="0" index="index" />
        <field key="name" dbtype="varchar" precision="191" 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="MODX\Revolution\modAccessPolicyTemplate" local="template" foreign="id" cardinality="one" owner="foreign" />
    </object>

    <object class="modAccessResource" table="access_resources" extends="MODX\Revolution\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="MODX\Revolution\modResource" local="target" foreign="id" owner="foreign" cardinality="one" />
        <aggregate alias="Context" class="MODX\Revolution\modContext" local="context_key" foreign="key" cardinality="one" owner="foreign" />
    </object>

    <object class="modAccessResourceGroup" table="access_resource_groups" extends="MODX\Revolution\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>

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

        <aggregate alias="Target" class="MODX\Revolution\modResourceGroup" local="target" foreign="id" owner="foreign" cardinality="one" />
        <aggregate alias="Context" class="MODX\Revolution\modContext" local="context_key" foreign="key" cardinality="one" owner="foreign" />
    </object>

    <!--
        Form customisation
        Defines rules (like, hide/move a field) that are applied on a specific action (controller, like resource/update)
    -->
    <object class="modActionDom" table="actiondom" extends="MODX\Revolution\modAccessibleSimpleObject">
        <field key="set" dbtype="int" precision="11" phptype="integer" null="false" default="0" index="index" />
        <field key="action" dbtype="varchar" precision="191" phptype="string" null="false" default="" index="index" />
        <field key="name" dbtype="varchar" precision="191" 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="MODX\Revolution\modFormCustomizationSet" local="set" foreign="id" cardinality="one" owner="foreign" />
        <composite alias="Access" class="MODX\Revolution\modAccessActionDom" local="id" foreign="target" cardinality="many" owner="local" />
    </object>

    <!--
        Form customisation
        Defines the fields that are available on an action (controller, like resource/update) that can be manipulated
    -->
    <object class="modActionField" table="actions_fields" extends="xPDO\Om\xPDOSimpleObject">
        <field key="action" dbtype="nvarchar" precision="191" phptype="string" null="false" default="" 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="191" 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="MODX\Revolution\modAction" local="action" foreign="id" cardinality="one" owner="foreign" />
    </object>

    <object class="modActiveUser" table="active_users" extends="xPDO\Om\xPDOObject">
        <field key="internalKey" dbtype="int" precision="9" attributes="unsigned" 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="MODX\Revolution\modUser" local="internalKey" foreign="id" cardinality="one" owner="foreign" />
    </object>

    <object class="modCategory" table="categories" extends="MODX\Revolution\modAccessibleSimpleObject">
        <field key="parent" dbtype="int" precision="10" phptype="integer" attributes="unsigned" default="0" index="unique" indexgrp="category" />
        <field key="category" dbtype="varchar" precision="45" phptype="string" null="false" default="" index="unique" indexgrp="category" />
        <field key="rank" dbtype="int" precision="11" phptype="integer" null="false" default="0" index="index" />

        <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="parent" length="" collation="A" null="false" />
            <column key="category" 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>

        <composite alias="Children" class="MODX\Revolution\modCategory" local="id" foreign="parent" cardinality="many" owner="local" />
        <aggregate alias="Parent" class="MODX\Revolution\modCategory" local="parent" foreign="id" cardinality="one" owner="foreign" />

        <aggregate alias="Chunks" class="MODX\Revolution\modChunk" key="id" local="id" foreign="category" cardinality="many" owner="local" />
        <aggregate alias="Snippets" class="MODX\Revolution\modSnippet" local="id" foreign="category" cardinality="many" owner="local" />
        <aggregate alias="Plugins" class="MODX\Revolution\modPlugin" local="id" foreign="category" cardinality="many" owner="local" />
        <aggregate alias="Templates" class="MODX\Revolution\modTemplate" local="id" foreign="category" cardinality="many" owner="local" />
        <aggregate alias="TemplateVars" class="MODX\Revolution\modTemplateVar" local="id" foreign="category" cardinality="many" owner="local" />
        <aggregate alias="PropertySets" class="MODX\Revolution\modPropertySet" local="id" foreign="category" cardinality="many" owner="local" />
        <composite alias="Acls" class="MODX\Revolution\modAccessCategory" local="id" foreign="target" owner="local" cardinality="many" />

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

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

    <object class="modCategoryClosure" table="categories_closure" extends="xPDO\Om\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="MODX\Revolution\modCategory" local="ancestor" foreign="id" cardinality="one" owner="foreign" />
        <aggregate alias="Descendant" class="MODX\Revolution\modCategory" local="descendant" foreign="id" cardinality="one" owner="foreign" />
    </object>

    <object class="modChunk" table="site_htmlsnippets" extends="MODX\Revolution\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" />
        <field key="static" dbtype="tinyint" precision="1" attributes="unsigned" phptype="boolean" null="false" default="0" index="index" />
        <field key="static_file" dbtype="varchar" precision="255" phptype="string" null="false" default="" />

        <alias key="content" field="snippet" />

        <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="static" name="static" primary="false" unique="false" type="BTREE">
            <column key="static" length="" collation="A" null="false" />
        </index>

        <composite alias="PropertySets" class="MODX\Revolution\modElementPropertySet" local="id" foreign="element" owner="local" cardinality="many">
            <criteria target="foreign"><![CDATA[
            {"element_class":"MODX\\Revolution\\modChunk"}
            ]]></criteria>
        </composite>
        <aggregate alias="Category" class="MODX\Revolution\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]+(?&lt;!\s)$/" message="chunk_err_invalid_name" />
        </validation>
    </object>

    <object class="modContentType" table="content_type" extends="xPDO\Om\xPDOSimpleObject">
        <field key="name" dbtype="varchar" precision="191" 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="icon" dbtype="tinytext" phptype="string" null="true" />
        <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="MODX\Revolution\modResource" local="id" foreign="content_type" owner="local" cardinality="many" />
        <validation>
            <rule field="name" name="name" type="xPDOValidationRule" rule="xPDO\Validation\xPDOMinLengthValidationRule" value="1" message="content_type_err_ns_name" />
        </validation>
    </object>

    <object class="modContext" table="context" extends="MODX\Revolution\modAccessibleObject">
        <field key="key" dbtype="varchar" precision="100" phptype="string" null="false" index="pk" />
        <field key="name" dbtype="varchar" precision="191" phptype="string" index="index" />
        <field key="description" dbtype="tinytext" phptype="string" />
        <field key="rank" dbtype="int" precision="11" phptype="integer" null="false" default="0" index="index" />

        <index alias="PRIMARY" name="PRIMARY" primary="true" unique="true" type="BTREE">
            <column key="key" 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="rank" name="rank" primary="false" unique="false" type="BTREE">
            <column key="rank" length="" collation="A" null="false" />
        </index>

        <composite alias="ContextResources" class="MODX\Revolution\modContextResource" local="key" foreign="context_key" cardinality="many" owner="local" />
        <composite alias="ContextSettings" class="MODX\Revolution\modContextSetting" local="key" foreign="context_key" cardinality="many" owner="local" />
        <composite alias="SourceElements" class="MODX\Revolution\Sources\modMediaSourceElement" local="key" foreign="context_key" cardinality="many" owner="local" />
        <composite alias="Acls" class="MODX\Revolution\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="xPDO\Om\xPDOObject">
        <field key="context_key" dbtype="varchar" precision="191" 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="true" default="NULL" 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="MODX\Revolution\modContext" key="context_key" local="context_key" foreign="key" cardinality="one" owner="foreign" />
        <aggregate alias="SystemSetting" class="MODX\Revolution\modSystemSetting" key="key" local="key" foreign="key" cardinality="one" owner="foreign" />
    </object>

    <object class="modContextResource" table="context_resource" extends="xPDO\Om\xPDOObject">
        <field key="context_key" dbtype="varchar" precision="191" phptype="string" null="false" index="pk" />
        <field key="resource" dbtype="int" precision="11" attributes="unsigned" phptype="integer" 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="MODX\Revolution\modContext" local="context_key" foreign="key" cardinality="one" owner="foreign" />
        <aggregate alias="Resource" class="MODX\Revolution\modResource" local="resource" foreign="id" cardinality="one" owner="foreign" />
    </object>

    <!-- A dashboard that shows on the loading screen for a user -->
    <object class="modDashboard" table="dashboard" extends="xPDO\Om\xPDOSimpleObject">
        <field key="name" dbtype="varchar" precision="191" phptype="string" null="false" default="" index="index" />
        <field key="description" dbtype="text" phptype="string" />
        <field key="hide_trees" dbtype="tinyint" precision="1" attributes="unsigned" phptype="boolean" null="false" default="0" index="index" />
        <field key="customizable" dbtype="tinyint" precision="1" attributes="unsigned" phptype="boolean" null="false" default="1" />

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

        <aggregate alias="UserGroups" class="MODX\Revolution\modUserGroup" local="id" foreign="dashboard" cardinality="many" owner="local" />
        <composite alias="Placements" class="MODX\Revolution\modDashboardWidgetPlacement" local="id" foreign="dashboard" cardinality="many" owner="local" />
    </object>

    <!-- Widgets that can be placed on dashboards. Can be files, html, or a snippet -->
    <object class="modDashboardWidget" table="dashboard_widget" extends="xPDO\Om\xPDOSimpleObject">
        <field key="name" dbtype="varchar" precision="191" phptype="string" null="false" default="" index="index" />
        <field key="description" dbtype="text" phptype="string" />
        <field key="type" dbtype="varchar" precision="100" phptype="string" null="false" index="index" /><!-- file/chunk/snippet -->
        <field key="content" dbtype="mediumtext" phptype="string" />
        <field key="properties" dbtype="text" phptype="json" null="true" />
        <field key="namespace" dbtype="varchar" precision="191" phptype="string" null="false" default="" index="index" />
        <field key="lexicon" dbtype="varchar" precision="191" phptype="string" null="false" default="core:dashboards" index="index" />
        <field key="size" dbtype="varchar" precision="255" phptype="string" null="false" default="half" />
        <field key="permission" dbtype="varchar" precision="255" phptype="string" null="false" default="" />

        <index alias="name" name="name" primary="false" unique="false" type="BTREE">
            <column key="name" 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="namespace" name="namespace" primary="false" unique="false" type="BTREE">
            <column key="namespace" length="" collation="A" null="false" />
        </index>
        <index alias="lexicon" name="lexicon" primary="false" unique="false" type="BTREE">
            <column key="lexicon" length="" collation="A" null="false" />
        </index>

        <aggregate alias="Namespace" class="MODX\Revolution\modNamespace" local="namespace" foreign="name" cardinality="one" owner="foreign" />
        <composite alias="Placements" class="MODX\Revolution\modDashboardWidgetPlacement" local="id" foreign="widget" cardinality="many" owner="local" />
    </object>

    <!-- Placements of widgets on a dashboard -->
    <object class="modDashboardWidgetPlacement" table="dashboard_widget_placement" extends="xPDO\Om\xPDOObject">
        <field key="user" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="0" index="pk" />
        <field key="dashboard" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="0" index="pk" />
        <field key="widget" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="0" index="pk" />
        <field key="rank" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="0" index="index" />
        <field key="size" dbtype="varchar" precision="255" phptype="string" null="false" default="half" />

        <index alias="PRIMARY" name="PRIMARY" primary="true" unique="true">
            <column key="user" collation="A" null="false" />
            <column key="dashboard" collation="A" null="false" />
            <column key="widget" 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="User" class="MODX\Revolution\modUser" local="user" foreign="id" cardinality="one" owner="foreign" />
        <aggregate alias="Dashboard" class="MODX\Revolution\modDashboard" local="dashboard" foreign="id" cardinality="one" owner="foreign" />
        <aggregate alias="Widget" class="MODX\Revolution\modDashboardWidget" local="widget" foreign="id" cardinality="one" owner="foreign" />
    </object>

    <object class="modDocument" extends="MODX\Revolution\modResource" />

    <object class="modElement" table="site_element" extends="MODX\Revolution\modAccessibleSimpleObject">
        <field key="source" dbtype="int" attributes="unsigned" phptype="integer" null="false" default="0" index="fk" />
        <field key="property_preprocess" dbtype="tinyint" precision="1" attributes="unsigned" phptype="boolean" null="false" default="0" />

        <composite alias="Acls" class="MODX\Revolution\modAccessElement" local="id" foreign="target" owner="local" cardinality="many" />
        <aggregate alias="CategoryAcls" class="MODX\Revolution\modAccessCategory" local="category" foreign="target" owner="local" cardinality="many" />
        <aggregate alias="Source" class="MODX\Revolution\Sources\modMediaSource" local="source" foreign="id" owner="foreign" cardinality="one" />
    </object>

    <object class="modElementPropertySet" table="element_property_sets" extends="xPDO\Om\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="MODX\Revolution\modElement" local="element" foreign="id" owner="foreign" cardinality="one" />
        <aggregate alias="PropertySet" class="MODX\Revolution\modPropertySet" local="property_set" foreign="id" owner="foreign" cardinality="one" />
    </object>

    <object class="modEvent" table="system_eventnames" extends="xPDO\Om\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="MODX\Revolution\modPluginEvent" local="name" foreign="event" cardinality="many" owner="local" />
    </object>

    <object class="modFormCustomizationProfileUserGroup" table="fc_profiles_usergroups" extends="xPDO\Om\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="MODX\Revolution\modUserGroup" local="usergroup" foreign="id" cardinality="one" owner="foreign" />
        <aggregate alias="Profile" class="MODX\Revolution\modFormCustomizationProfile" local="profile" foreign="id" cardinality="one" owner="foreign" />
    </object>
    <object class="modFormCustomizationProfile" table="fc_profiles" extends="xPDO\Om\xPDOSimpleObject">
        <field key="name" dbtype="varchar" precision="191" 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="MODX\Revolution\modFormCustomizationSet" local="id" foreign="profile" cardinality="many" owner="local" />
        <composite alias="UserGroups" class="MODX\Revolution\modFormCustomizationProfileUserGroup" local="id" foreign="profile" cardinality="many" owner="local" />
    </object>

    <object class="modFormCustomizationSet" table="fc_sets" extends="xPDO\Om\xPDOSimpleObject">
        <field key="profile" dbtype="integer" precision="11" phptype="integer" null="false" default="0" index="index" />
        <field key="action" dbtype="varchar" precision="191" 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="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="Template" class="MODX\Revolution\modTemplate" local="template" foreign="id" cardinality="one" owner="foreign" />
        <aggregate alias="Profile" class="MODX\Revolution\modFormCustomizationProfile" local="profile" foreign="id" cardinality="one" owner="foreign" />
        <composite alias="Rules" class="MODX\Revolution\modActionDom" local="id" foreign="set" cardinality="many" owner="local" />
    </object>

    <object class="modLexiconEntry" table="lexicon_entries" extends="xPDO\Om\xPDOSimpleObject">
        <field key="name" dbtype="varchar" precision="191" phptype="string" null="false" default="" index="index" />
        <field key="value" dbtype="text" phptype="string" null="false" default="" />
        <field key="topic" dbtype="varchar" precision="191" 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="true" default="NULL" 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="MODX\Revolution\modNamespace" local="namespace" foreign="name" cardinality="one" owner="foreign" />
    </object>

    <object class="modManagerLog" table="manager_log" extends="xPDO\Om\xPDOSimpleObject">
        <field key="user" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="0" />
        <field key="occurred" dbtype="datetime" phptype="datetime" null="false" default="CURRENT_TIMESTAMP" />
        <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" />

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

        <aggregate alias="User" class="MODX\Revolution\modUser" local="user" foreign="id" owner="foreign" cardinality="one" />
    </object>

    <object class="modMenu" table="menus" extends="MODX\Revolution\modAccessibleObject">
        <field key="text" dbtype="varchar" precision="191" phptype="string" null="false" default="" index="pk" />
        <field key="parent" dbtype="varchar" precision="191" phptype="string" null="false" default="" index="index" />
        <field key="action" dbtype="varchar" precision="191" phptype="string" null="false" default="" 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="" />
        <field key="namespace" dbtype="varchar" precision="100" phptype="string" null="false" default="core" index="index" />

        <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>
        <index alias="namespace" name="namespace" primary="false" unique="false" type="BTREE">
            <column key="namespace" length="" collation="A" null="false" />
        </index>

        <aggregate alias="Parent" class="MODX\Revolution\modMenu" local="parent" foreign="text" owner="foreign" cardinality="one" />
        <aggregate alias="Children" class="MODX\Revolution\modMenu" local="text" foreign="parent" owner="local" cardinality="many" />
        <composite alias="Acls" class="MODX\Revolution\modAccessMenu" local="text" foreign="target" owner="local" cardinality="many" />
    </object>

    <!--
        Development namespacing object by which MODX extension development is done. Provides a centralized path location
        and grouping name for organizing development silos within MODX.
    -->
    <object class="modNamespace" table="namespaces" extends="MODX\Revolution\modAccessibleObject">
        <!-- A lowercase namespace name that this Namespace will be referred as -->
        <field key="name" dbtype="varchar" precision="40" phptype="string" null="false" default="" index="pk" />
        <!-- The core path of the Namespace, where the PHP files will reside -->
        <field key="path" dbtype="text" phptype="string" default="" />
        <!-- The assets path of the Namespace, where images/css/js and any public-facing files will reside -->
        <field key="assets_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="MODX\Revolution\modLexiconEntry" local="name" foreign="namespace" cardinality="many" owner="local" />
        <composite alias="SystemSettings" class="MODX\Revolution\modSystemSetting" local="name" foreign="namespace" cardinality="many" owner="local" />
        <composite alias="ContextSettings" class="MODX\Revolution\modContextSetting" local="name" foreign="namespace" cardinality="many" owner="local" />
        <composite alias="UserSettings" class="MODX\Revolution\modUserSetting" local="name" foreign="namespace" cardinality="many" owner="local" />
        <composite alias="ExtensionPackages" class="MODX\Revolution\modExtensionPackage" local="name" foreign="namespace" cardinality="many" owner="local" />
        <composite alias="Acls" class="MODX\Revolution\modAccessNamespace" local="name" foreign="target" owner="local" cardinality="many" />
    </object>

    <!--
        Extension packages load xPDO models during modX instantiation, allowing for custom database tables and other
        models to be loaded prior to modX request handling. Useful for when you want to integrate custom data and
        extensions, such as Custom Resource Classes, into the core.
    -->
    <object class="modExtensionPackage" table="extension_packages" extends="xPDO\Om\xPDOSimpleObject">
        <!-- The namespace the extension package relates to -->
        <field key="namespace" dbtype="varchar" precision="40" phptype="string" null="false" default="core" index="index" />
        <!-- If empty, will assume the Namespace name -->
        <field key="name" dbtype="varchar" precision="100" phptype="string" null="false" default="core" index="index" />
        <!-- If empty, will assume the Namespace path -->
        <field key="path" dbtype="text" phptype="string" null="true" />
        <!-- If empty, will assume no table prefix and delegate to package schema -->
        <field key="table_prefix" dbtype="varchar" precision="255" phptype="string" null="false" default="" />
        <!-- If specified, will create an instance of the class with this name using modX.getService on the loading of this extension package -->
        <field key="service_class" dbtype="varchar" precision="255" phptype="string" null="false" default="" />
        <!-- The name to give the service on the modX object when instantiating. Only valid if service_class is not empty. -->
        <field key="service_name" dbtype="varchar" precision="255" phptype="string" null="false" default="" />
        <!-- When this extension package was made -->
        <field key="created_at" dbtype="datetime" phptype="datetime" null="true" />
        <!-- The last time this extension package was updated -->
        <field key="updated_at" dbtype="datetime" phptype="datetime" null="true" />

        <index alias="namespace" name="namespace" primary="false" unique="false" type="BTREE">
            <column key="namespace" 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="Namespace" class="MODX\Revolution\modNamespace" local="namespace" foreign="name" cardinality="one" owner="foreign" />
    </object>

    <object class="modPlugin" table="site_plugins" extends="MODX\Revolution\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" />
        <field key="static" dbtype="tinyint" precision="1" attributes="unsigned" phptype="boolean" null="false" default="0" index="index" />
        <field key="static_file" dbtype="varchar" precision="255" phptype="string" null="false" default="" />

        <alias key="content" field="plugincode" />

        <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>
        <index alias="static" name="static" primary="false" unique="false" type="BTREE">
            <column key="static" length="" collation="A" null="false" />
        </index>

        <composite alias="PropertySets" class="MODX\Revolution\modElementPropertySet" local="id" foreign="element" owner="local" cardinality="many">
            <criteria target="foreign"><![CDATA[
            {"element_class":"MODX\\Revolution\\modPlugin"}
            ]]></criteria>
        </composite>
        <composite alias="PluginEvents" class="MODX\Revolution\modPluginEvent" local="id" foreign="pluginid" cardinality="many" owner="local" />
        <validation>
            <rule field="name" name="invalid" type="preg_match" rule="/^(?!\s)[a-zA-Z0-9\x23-\x2f\x3a\x5b-\x5d\x7f-\xff-_\s]+(?&lt;!\s)$/" message="plugin_err_invalid_name" />
        </validation>
    </object>

    <object class="modPluginEvent" table="site_plugin_events" extends="xPDO\Om\xPDOObject">
        <field key="pluginid" dbtype="int" precision="10" phptype="integer" null="false" default="0" index="pk" />
        <field key="event" dbtype="varchar" precision="191" 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="MODX\Revolution\modPlugin" local="pluginid" foreign="id" cardinality="one" owner="foreign" />
        <aggregate alias="Event" class="MODX\Revolution\modEvent" local="event" foreign="name" cardinality="one" owner="foreign" />
        <aggregate alias="PropertySet" class="MODX\Revolution\modPropertySet" local="propertyset" foreign="id" cardinality="one" owner="foreign" />
    </object>

    <object class="modPrincipal" extends="xPDO\Om\xPDOSimpleObject">
        <composite alias="Acls" class="modAccess" local="id" foreign="principal" cardinality="many" owner="local" />
    </object>

    <object class="modPropertySet" table="property_set" extends="xPDO\Om\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="MODX\Revolution\modCategory" key="id" local="category" foreign="id" cardinality="one" owner="foreign" />
        <composite alias="Elements" class="MODX\Revolution\modElementPropertySet" local="id" foreign="property_set" cardinality="many" owner="local" />
    </object>

    <object class="modResource" table="site_content" extends="MODX\Revolution\modAccessibleSimpleObject" inherit="single">
        <field key="type" dbtype="varchar" precision="20" phptype="string" null="false" default="document" />
        <field key="pagetitle" dbtype="varchar" precision="191" phptype="string" null="false" default="" index="fulltext" indexgrp="content_ft_idx" />
        <field key="longtitle" dbtype="varchar" precision="191" phptype="string" null="false" default="" index="fulltext" indexgrp="content_ft_idx" />
        <field key="description" dbtype="text" phptype="string" null="false" default="" index="fulltext" indexgrp="content_ft_idx" />
        <field key="alias" dbtype="varchar" precision="191" 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" attributes="unsigned" 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="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="MODX\Revolution\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" />
        <field key="hide_children_in_tree" dbtype="tinyint" precision="1" phptype="integer" null="false" default="0" index="index" />
        <field key="show_in_tree" dbtype="tinyint" precision="1" phptype="integer" null="false" default="1" index="index" />
        <field key="properties" dbtype="mediumtext" phptype="json" null="true" />
        <field key="alias_visible" dbtype="tinyint" precision="1" attributes="unsigned" phptype="boolean" null="false" default="1" />

        <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="191" 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="hide_children_in_tree" name="hide_children_in_tree" primary="false" unique="false" type="BTREE">
            <column key="hide_children_in_tree" length="" collation="A" null="false" />
        </index>
        <index alias="show_in_tree" name="show_in_tree" primary="false" unique="false" type="BTREE">
            <column key="show_in_tree" 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>
        <index alias="cache_refresh_index" name="cache_refresh_idx" primary="false" unique="false" type="BTREE">
            <column key="parent" length="" collation="A" null="false" />
            <column key="menuindex" length="" collation="A" null="false" />
            <column key="id" length="" collation="A" null="false" />
        </index>

        <aggregate alias="Parent" class="MODX\Revolution\modResource" local="parent" foreign="id" cardinality="one" owner="foreign" />
        <aggregate alias="CreatedBy" class="MODX\Revolution\modUser" local="createdby" foreign="id" cardinality="one" owner="foreign" />
        <aggregate alias="EditedBy" class="MODX\Revolution\modUser" local="editedby" foreign="id" cardinality="one" owner="foreign" />
        <aggregate alias="DeletedBy" class="MODX\Revolution\modUser" local="deletedby" foreign="id" cardinality="one" owner="foreign" />
        <aggregate alias="PublishedBy" class="MODX\Revolution\modUser" local="publishedby" foreign="id" cardinality="one" owner="foreign" />
        <aggregate alias="Template" class="MODX\Revolution\modTemplate" local="template" foreign="id" cardinality="one" owner="foreign" />
        <aggregate alias="TemplateVars" class="MODX\Revolution\modTemplateVar" local="id:template" foreign="contentid:templateid" cardinality="many" owner="local" />
        <aggregate alias="TemplateVarTemplates" class="MODX\Revolution\modTemplateVarTemplate" local="template" foreign="templateid" cardinality="many" owner="local" />
        <aggregate alias="ContentType" class="MODX\Revolution\modContentType" local="content_type" foreign="id" owner="foreign" cardinality="one" />
        <aggregate alias="Context" class="MODX\Revolution\modContext" local="context_key" foreign="key" owner="foreign" cardinality="one" />
        <composite alias="Children" class="MODX\Revolution\modResource" local="id" foreign="parent" cardinality="many" owner="local" />
        <composite alias="TemplateVarResources" class="MODX\Revolution\modTemplateVarResource" local="id" foreign="contentid" cardinality="many" owner="local" />
        <composite alias="ResourceGroupResources" class="MODX\Revolution\modResourceGroupResource" local="id" foreign="document" cardinality="many" owner="local" />
        <composite alias="Acls" class="MODX\Revolution\modAccessResource" local="id" foreign="target" owner="local" cardinality="many" />
        <composite alias="ContextResources" class="MODX\Revolution\modContextResource" local="id" foreign="resource" cardinality="many" owner="local" />
    </object>

    <object class="modResourceGroup" table="documentgroup_names" extends="MODX\Revolution\modAccessibleSimpleObject">
        <field key="name" dbtype="varchar" precision="191" 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="MODX\Revolution\modResourceGroupResource" local="id" foreign="document_group" cardinality="many" owner="local" />
        <composite alias="TemplateVarResourceGroups" class="MODX\Revolution\modTemplateVarResourceGroup" local="id" foreign="documentgroup" cardinality="many" owner="local" />
        <composite alias="Acls" class="MODX\Revolution\modAccessResourceGroup" local="id" foreign="target" owner="local" cardinality="many" />
    </object>

    <object class="modResourceGroupResource" table="document_groups" extends="xPDO\Om\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="MODX\Revolution\modResourceGroup" key="id" local="document_group" foreign="id" cardinality="one" owner="foreign" />
        <aggregate alias="Resource" class="MODX\Revolution\modResource" key="id" local="document" foreign="id" cardinality="one" owner="foreign" />
    </object>

    <object class="modScript" table="site_script" extends="MODX\Revolution\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="MODX\Revolution\modCategory" key="id" local="category" foreign="id" cardinality="one" owner="foreign" />
    </object>

    <object class="modSession" table="session" extends="xPDO\Om\xPDOObject">
        <field key="id" dbtype="varchar" precision="191" phptype="string" null="false" index="pk" default="" />
        <field key="access" dbtype="int" precision="20" phptype="timestamp" null="false" 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>
        <index alias="access" name="access" primary="false" unique="false" type="BTREE">
            <column key="access" length="" collation="A" null="false" />
        </index>

        <validation>
            <rule field="id" name="invalid" type="preg_match" rule="/^[0-9a-zA-Z,-]{22,191}$/" message="session_err_invalid_id" />
        </validation>
    </object>

    <object class="modSnippet" table="site_snippets" extends="MODX\Revolution\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" />
        <field key="static" dbtype="tinyint" precision="1" attributes="unsigned" phptype="boolean" null="false" default="0" index="index" />
        <field key="static_file" dbtype="varchar" precision="255" phptype="string" null="false" default="" />

        <alias key="content" field="snippet" />

        <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>
        <index alias="static" name="static" primary="false" unique="false" type="BTREE">
            <column key="static" length="" collation="A" null="false" />
        </index>

        <composite alias="PropertySets" class="MODX\Revolution\modElementPropertySet" local="id" foreign="element" owner="local" cardinality="many">
            <criteria target="foreign"><![CDATA[
            {"element_class":"MODX\\Revolution\\modSnippet"}
            ]]></criteria>
        </composite>

        <validation>
            <rule field="name" name="invalid" type="preg_match" rule="/^(?!\s)[a-zA-Z0-9\x2d-\x2f\x7f-\xff-_\s]+(?&lt;!\s)$/" message="snippet_err_invalid_name" />
        </validation>
    </object>

    <object class="modStaticResource" extends="MODX\Revolution\modResource" />

    <object class="modSymLink" extends="MODX\Revolution\modResource" />

    <object class="modSystemSetting" table="system_settings" extends="xPDO\Om\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="true" default="NULL" 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="MODX\Revolution\modContextSetting" local="key" foreign="key" cardinality="one" owner="local" />
        <aggregate alias="Namespace" class="MODX\Revolution\modNamespace" local="namespace" foreign="name" cardinality="one" owner="foreign" />
    </object>

    <object class="modTemplate" table="site_templates" extends="MODX\Revolution\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="" />
        <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" />
        <field key="static" dbtype="tinyint" precision="1" attributes="unsigned" phptype="boolean" null="false" default="0" index="index" />
        <field key="static_file" dbtype="varchar" precision="255" phptype="string" null="false" default="" />
        <field key="preview_file" dbtype="varchar" precision="191" phptype="string" null="false" default="" />

        <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>
        <index alias="static" name="static" primary="false" unique="false" type="BTREE">
            <column key="static" length="" collation="A" null="false" />
        </index>

        <composite alias="PropertySets" class="MODX\Revolution\modElementPropertySet" local="id" foreign="element" owner="local" cardinality="many">
            <criteria target="foreign"><![CDATA[
            {"element_class":"MODX\\Revolution\\modTemplate"}
            ]]></criteria>
        </composite>
        <aggregate alias="Category" class="MODX\Revolution\modCategory" local="category" foreign="id" cardinality="one" owner="foreign" />
        <aggregate alias="Resources" class="MODX\Revolution\modResource" local="id" foreign="template" cardinality="many" owner="local" />
        <composite alias="TemplateVarTemplates" class="MODX\Revolution\modTemplateVarTemplate" local="id" foreign="templateid" cardinality="many" owner="local" />

        <validation>
            <rule field="templatename" name="invalid" type="preg_match" rule="/^(?!\s)[a-zA-Z0-9\x23-\x2f\x3a\x5b-\x5d\x7f-\xff-_\s]+(?&lt;!\s)$/" message="template_err_invalid_name" />
        </validation>
    </object>

    <object class="modTemplateVar" table="site_tmplvars" extends="MODX\Revolution\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="mediumtext" 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" />
        <field key="static" dbtype="tinyint" precision="1" attributes="unsigned" phptype="boolean" null="false" default="0" index="index" />
        <field key="static_file" dbtype="varchar" precision="255" phptype="string" null="false" default="" />

        <alias key="content" field="default_text" />

        <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>
        <index alias="static" name="static" primary="false" unique="false" type="BTREE">
            <column key="static" length="" collation="A" null="false" />
        </index>

        <composite alias="PropertySets" class="MODX\Revolution\modElementPropertySet" local="id" foreign="element" owner="local" cardinality="many">
            <criteria target="foreign"><![CDATA[
            {"element_class":"MODX\\Revolution\\modTemplateVar"}
            ]]></criteria>
        </composite>
        <aggregate alias="Category" class="MODX\Revolution\modCategory" local="category" foreign="id" cardinality="one" owner="foreign" />
        <composite alias="TemplateVarTemplates" class="MODX\Revolution\modTemplateVarTemplate" local="id" foreign="tmplvarid" cardinality="many" owner="local" />
        <composite alias="TemplateVarResources" class="MODX\Revolution\modTemplateVarResource" local="id" foreign="tmplvarid" cardinality="many" owner="local" />
        <composite alias="TemplateVarResourceGroups" class="MODX\Revolution\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]+(?&lt;!\s)$/" message="tv_err_invalid_name" />
            <rule field="name" name="reserved" type="preg_match" rule="/^(?!(id|type|pagetitle|longtitle|description|alias|alias_visible|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|content_dispo|hidemenu|class_key|context_key|content_type|uri|uri_override|hide_children_in_tree|show_in_tree|properties)$)/" message="tv_err_reserved_name" />
        </validation>
    </object>

    <object class="modTemplateVarResource" table="site_tmplvar_contentvalues" extends="xPDO\Om\xPDOSimpleObject">
        <field key="tmplvarid" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="0" index="index" />
        <field key="contentid" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="0" index="index" />
        <field key="value" dbtype="mediumtext" 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>
        <index alias="tv_cnt" name="tv_cnt" primary="false" unique="true" type="BTREE">
            <column key="tmplvarid" length="" collation="A" null="false" />
            <column key="contentid" length="" collation="A" null="false" />
        </index>

        <aggregate alias="TemplateVar" class="MODX\Revolution\modTemplateVar" local="tmplvarid" foreign="id" cardinality="one" owner="foreign" />
        <aggregate alias="Resource" class="MODX\Revolution\modResource" local="contentid" foreign="id" cardinality="one" owner="foreign" />
    </object>

    <object class="modTemplateVarResourceGroup" table="site_tmplvar_access" extends="xPDO\Om\xPDOSimpleObject">
        <field key="tmplvarid" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="0" />
        <field key="documentgroup" dbtype="int" precision="10" phptype="integer" null="false" default="0" />

        <index alias="tmplvar_template" name="tmplvar_template" type="BTREE">
            <column key="tmplvarid" length="" collation="A" null="false" />
            <column key="documentgroup" length="" collation="A" null="false" />
        </index>

        <aggregate alias="TemplateVar" class="MODX\Revolution\modTemplateVar" local="tmplvarid" foreign="id" cardinality="one" owner="foreign" />
        <aggregate alias="ResourceGroup" class="MODX\Revolution\modResourceGroup" local="documentgroup" foreign="id" cardinality="one" owner="foreign" />
    </object>

    <object class="modTemplateVarTemplate" table="site_tmplvar_templates" extends="xPDO\Om\xPDOObject">
        <field key="tmplvarid" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="0" index="pk" />
        <field key="templateid" dbtype="int" precision="11" attributes="unsigned" 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="MODX\Revolution\modTemplateVar" key="id" local="tmplvarid" foreign="id" cardinality="one" owner="foreign" />
        <aggregate alias="Template" class="MODX\Revolution\modTemplate" key="id" local="templateid" foreign="id" cardinality="one" owner="foreign" />
    </object>

    <object class="modUser" table="users" extends="MODX\Revolution\modPrincipal">
        <field key="username" dbtype="varchar" precision="100" phptype="string" null="false" default="" index="unique" />
        <field key="password" dbtype="varchar" precision="255" phptype="string" null="false" default="" />
        <field key="cachepwd" dbtype="varchar" precision="255" phptype="string" null="false" default="" />
        <field key="class_key" dbtype="varchar" precision="100" phptype="string" null="false" default="MODX\Revolution\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="191" 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="MODX\Revolution\Hashing\modNative" />
        <field key="salt" dbtype="varchar" precision="100" phptype="string" null="false" default="" />
        <field key="primary_group" dbtype="int" precision="10" phptype="integer" attributes="unsigned" null="false" default="0" index="index" />
        <field key="session_stale" dbtype="text" phptype="array" null="true" />
        <field key="sudo" dbtype="tinyint" precision="1" phptype="boolean" attributes="unsigned" null="false" default="0" />
        <field key="createdon" dbtype="int" precision="20" phptype="timestamp" null="false" default="0" />

        <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>
        <index alias="primary_group" name="primary_group" primary="false" unique="false" type="BTREE">
            <column key="primary_group" length="" collation="A" null="false" />
        </index>

        <aggregate alias="CreatedResources" class="MODX\Revolution\modResource" local="id" foreign="createdby" cardinality="many" owner="local" />
        <aggregate alias="EditedResources" class="MODX\Revolution\modResource" local="id" foreign="editedby" cardinality="many" owner="local" />
        <aggregate alias="DeletedResources" class="MODX\Revolution\modResource" local="id" foreign="deletedby" cardinality="many" owner="local" />
        <aggregate alias="PublishedResources" class="MODX\Revolution\modResource" local="id" foreign="publishedby" cardinality="many" owner="local" />
        <aggregate alias="SentMessages" class="MODX\Revolution\modUserMessage" local="id" foreign="sender" cardinality="many" owner="local" />
        <aggregate alias="ReceivedMessages" class="MODX\Revolution\modUserMessage" local="id" foreign="recipient" cardinality="many" owner="local" />
        <aggregate alias="PrimaryGroup" class="MODX\Revolution\modUserGroup" local="primary_group" foreign="id" cardinality="one" owner="foreign" />
        <composite alias="Profile" class="MODX\Revolution\modUserProfile" local="id" foreign="internalKey" cardinality="one" owner="local" />
        <composite alias="UserSettings" class="MODX\Revolution\modUserSetting" local="id" foreign="user" cardinality="many" owner="local" />
        <composite alias="UserGroupMembers" class="MODX\Revolution\modUserGroupMember" local="id" foreign="member" cardinality="many" owner="local" />
        <composite alias="ActiveUsers" class="MODX\Revolution\modActiveUser" local="id" foreign="internalKey" cardinality="many" owner="local" />
        <composite alias="DashboardWidgets" class="MODX\Revolution\modDashboardWidgetPlacement" local="id" foreign="user" cardinality="many" owner="local" />
    </object>

    <object class="modUserGroup" table="membergroup_names" extends="MODX\Revolution\modPrincipal">
        <field key="name" dbtype="varchar" precision="191" 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" />
        <field key="dashboard" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="1" 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>
        <index alias="dashboard" name="dashboard" primary="false" unique="false" type="BTREE">
            <column key="dashboard" length="" collation="A" null="false" />
        </index>

        <aggregate alias="Parent" class="MODX\Revolution\modUserGroup" local="parent" foreign="id" cardinality="one" owner="foreign" />
        <aggregate alias="Dashboard" class="MODX\Revolution\modDashboard" local="dashboard" foreign="id" cardinality="one" owner="foreign" />
        <composite alias="Children" class="MODX\Revolution\modUserGroup" local="id" foreign="parent" cardinality="many" owner="local" />
        <composite alias="UserGroupMembers" class="MODX\Revolution\modUserGroupMember" local="id" foreign="user_group" cardinality="many" owner="local" />
        <composite alias="FormCustomizationProfiles" class="MODX\Revolution\modFormCustomizationProfileUserGroup" local="id" foreign="usergroup" cardinality="many" owner="local" />
    </object>

    <object class="modUserGroupMember" table="member_groups" extends="xPDO\Om\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="MODX\Revolution\modUserGroupRole" local="role" foreign="id" cardinality="one" owner="foreign" />
        <aggregate alias="UserGroup" class="MODX\Revolution\modUserGroup" local="user_group" foreign="id" cardinality="one" owner="foreign" />
        <aggregate alias="User" class="MODX\Revolution\modUser" local="member" foreign="id" cardinality="one" owner="foreign" />
    </object>

    <object class="modUserGroupRole" table="user_group_roles" extends="xPDO\Om\xPDOSimpleObject">
        <field key="name" dbtype="varchar" precision="191" 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="unique" />

        <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="true" type="BTREE">
            <column key="authority" length="" collation="A" null="false" />
        </index>

        <aggregate alias="UserGroupMembers" class="MODX\Revolution\modUserGroupMember" local="id" foreign="role" cardinality="many" owner="local" />
    </object>

    <object class="modUserGroupSetting" table="user_group_settings" extends="xPDO\Om\xPDOObject">
        <field key="group" dbtype="integer" attributes="unsigned" phptype="integer" null="false" default="0" index="pk" />
        <field key="key" dbtype="varchar" precision="50" phptype="string" null="false" 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="true" default="NULL" attributes="ON UPDATE CURRENT_TIMESTAMP" />

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

        <aggregate alias="UserGroup" class="MODX\Revolution\modUserGroup" local="group" foreign="id" cardinality="one" owner="foreign" />
        <aggregate alias="Namespace" class="MODX\Revolution\modNamespace" local="namespace" foreign="name" cardinality="one" owner="foreign" />
    </object>

    <object class="modUserMessage" table="user_messages" extends="xPDO\Om\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" attributes="unsigned" phptype="integer" null="false" default="0" />
        <field key="recipient" dbtype="int" precision="10" attributes="unsigned" 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="true" default="NULL" />
        <field key="read" dbtype="tinyint" precision="1" phptype="integer" null="false" default="0" />

        <aggregate alias="Sender" class="MODX\Revolution\modUser" local="sender" foreign="id" cardinality="one" owner="foreign" />
        <aggregate alias="Recipient" class="MODX\Revolution\modUser" local="recipient" foreign="id" cardinality="one" owner="foreign" />
    </object>

    <object class="modUserProfile" table="user_attributes" extends="xPDO\Om\xPDOSimpleObject">
        <field key="internalKey" dbtype="int" precision="10" attributes="unsigned" 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="" /> <!-- deprecated - to be removed in 3.2 -->
        <field key="dob" dbtype="int" precision="10" phptype="integer" null="false" default="0" />
        <field key="gender" dbtype="tinyint" 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="MODX\Revolution\modUser" local="internalKey" foreign="id" cardinality="one" owner="foreign" />
    </object>

    <object class="modUserSetting" table="user_settings" extends="xPDO\Om\xPDOObject">
        <field key="user" dbtype="int" precision="11" attributes="unsigned" 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="true" default="NULL" 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="MODX\Revolution\modUser" local="user" foreign="id" cardinality="one" owner="foreign" />
        <aggregate alias="Namespace" class="MODX\Revolution\modNamespace" local="namespace" foreign="name" cardinality="one" owner="foreign" />
    </object>

    <object class="modWebLink" extends="MODX\Revolution\modResource" />

    <object class="modWorkspace" table="workspaces" extends="xPDO\Om\xPDOSimpleObject">
        <field key="name" dbtype="varchar" precision="191" phptype="string" null="false" default="" index="index" />
        <field key="path" dbtype="varchar" precision="191" 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="active" primary="false" unique="false" type="BTREE">
            <column key="active" length="" collation="A" null="false" />
        </index>

        <composite alias="Packages" class="MODX\Revolution\Transport\modTransportPackage" local="id" foreign="workspace" cardinality="many" owner="local" />
    </object>

    <object class="modDeprecatedMethod" table="deprecated_method" extends="xPDO\Om\xPDOSimpleObject">
        <field key="definition" dbtype="varchar" precision="191" phptype="string" null="false" default="" />
        <field key="since" dbtype="varchar" precision="191" phptype="string" null="false" default="" />
        <field key="recommendation" dbtype="varchar" precision="1024" phptype="string" null="false" default="" />

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

        <composite alias="Callers" class="MODX\Revolution\modDeprecatedCall" local="id" foreign="method" cardinality="many" owner="local" />
    </object>

    <object class="modDeprecatedCall" table="deprecated_call" extends="xPDO\Om\xPDOSimpleObject">
        <field key="method" dbtype="int" precision="11" attributes="unsigned" phptype="integer" null="false" default="0" />
        <field key="call_count" dbtype="int" precision="11" attributes="unsigned" phptype="integer" null="false" default="0" />

        <field key="caller" dbtype="varchar" precision="191" phptype="string" null="false" default="" />
        <field key="caller_file" dbtype="varchar" precision="191" phptype="string" null="false" default="" />
        <field key="caller_line" dbtype="int" precision="11" attributes="unsigned" phptype="integer" null="false" default="0" />

        <index alias="method" name="method" primary="false" unique="false" type="BTREE">
            <column key="method" length="" collation="A" null="false" />
        </index>
        <index alias="call_count" name="call_count" primary="false" unique="false" type="BTREE">
            <column key="call_count" length="" collation="A" null="false" />
        </index>
        <index alias="caller" name="caller" primary="false" unique="false" type="BTREE">
            <column key="caller" length="" collation="A" null="false" />
        </index>
        <index alias="caller_file" name="caller_file" primary="false" unique="false" type="BTREE">
            <column key="caller_file" length="" collation="A" null="false" />
        </index>
        <index alias="caller_line" name="caller_line" primary="false" unique="false" type="BTREE">
            <column key="caller_line" length="" collation="A" null="false" />
        </index>

        <aggregate alias="Method" class="MODX\Revolution\modDeprecatedMethod" local="method" foreign="id" cardinality="one" owner="foreign" />
    </object>
    <!-- MOVE DEPRECATED OBJECT DEFINITIONS BELOW HERE -->
</model>
