<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="local/autogroup/db" VERSION="20141228" COMMENT="XMLDB file for Moodle local/autogroup"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
        >
    <TABLES>
        <TABLE NAME="local_autogroup_set" COMMENT="Config for autogroups on courses">
            <FIELDS>
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
                <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" COMMENT="What course does this link to?"/>
                <FIELD NAME="sortmodule" TYPE="char" LENGTH="100" NOTNULL="false" SEQUENCE="false" COMMENT="What module should be used for sorting users into groups?" />
                <FIELD NAME="sortconfig" TYPE="char" LENGTH="1000" NOTNULL="false" SEQUENCE="false" COMMENT="JSON encoded module configuration" />
                <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="false" DEFAULT="0" SEQUENCE="false" />
                <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="false" DEFAULT="0" SEQUENCE="false" />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
                <KEY NAME="courseid" TYPE="foreign" FIELDS="courseid" REFTABLE="course" REFFIELDS="id"/>
            </KEYS>
        </TABLE>
        <TABLE NAME="local_autogroup_roles" COMMENT="Config for autogroups on courses">
            <FIELDS>
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
                <FIELD NAME="setid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" COMMENT="What autogroup set does this link to?"/>
                <FIELD NAME="roleid" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false" COMMENT="What role should be included in the autogroup rules?" />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
                <KEY NAME="roleid" TYPE="foreign" FIELDS="roleid" REFTABLE="role" REFFIELDS="id"/>
            </KEYS>
        </TABLE>
        <TABLE NAME="local_autogroup_manual" COMMENT="Tracks manually assigned Users to autogroup groups">
            <FIELDS>
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
                <FIELD NAME="groupid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" COMMENT="Group ID of this record."/>
                <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" COMMENT="User ID of this record." />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
            </KEYS>
        </TABLE>
    </TABLES>
</XMLDB>