MDL-10364 Added calculation icon, changed customdata to set_data for feedback form.
[moodle.git] / lib / db / install.xml
CommitLineData
67d7d694 1<?xml version="1.0" encoding="UTF-8" ?>
f13002d5 2<XMLDB PATH="lib/db" VERSION="20070630" COMMENT="XMLDB file for core Moodle tables"
647a2566 3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4 xsi:noNamespaceSchemaLocation="../../lib/xmldb/xmldb.xsd"
5>
67d7d694 6 <TABLES>
7 <TABLE NAME="config" COMMENT="Moodle configuration variables" NEXT="config_plugins">
8 <FIELDS>
9 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="name"/>
10 <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="value"/>
11 <FIELD NAME="value" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="name"/>
12 </FIELDS>
13 <KEYS>
14 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for config" NEXT="name"/>
15 <KEY NAME="name" TYPE="unique" FIELDS="name" PREVIOUS="primary"/>
16 </KEYS>
17 </TABLE>
18 <TABLE NAME="config_plugins" COMMENT="Moodle modules and plugins configuration variables" PREVIOUS="config" NEXT="course">
19 <FIELDS>
20 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="plugin"/>
21 <FIELD NAME="plugin" TYPE="char" LENGTH="100" NOTNULL="true" DEFAULT="core" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="name"/>
22 <FIELD NAME="name" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="plugin" NEXT="value"/>
23 <FIELD NAME="value" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="name"/>
24 </FIELDS>
25 <KEYS>
26 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for config_plugins" NEXT="plugin_name"/>
27 <KEY NAME="plugin_name" TYPE="unique" FIELDS="plugin, name" PREVIOUS="primary"/>
28 </KEYS>
29 </TABLE>
30 <TABLE NAME="course" COMMENT="Central course table" PREVIOUS="config_plugins" NEXT="course_categories">
31 <FIELDS>
32 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="category"/>
33 <FIELD NAME="category" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="sortorder"/>
34 <FIELD NAME="sortorder" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="category" NEXT="password"/>
35 <FIELD NAME="password" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="sortorder" NEXT="fullname"/>
36 <FIELD NAME="fullname" TYPE="char" LENGTH="254" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="password" NEXT="shortname"/>
37 <FIELD NAME="shortname" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="fullname" NEXT="idnumber"/>
38 <FIELD NAME="idnumber" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="shortname" NEXT="summary"/>
39 <FIELD NAME="summary" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="idnumber" NEXT="format"/>
40 <FIELD NAME="format" TYPE="char" LENGTH="10" NOTNULL="true" DEFAULT="topics" SEQUENCE="false" ENUM="false" PREVIOUS="summary" NEXT="showgrades"/>
41 <FIELD NAME="showgrades" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="format" NEXT="modinfo"/>
a974b5a4 42 <FIELD NAME="modinfo" TYPE="text" LENGTH="big" NOTNULL="false" SEQUENCE="false" ENUM="false" PREVIOUS="showgrades" NEXT="newsitems"/>
67d7d694 43 <FIELD NAME="newsitems" TYPE="int" LENGTH="5" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="modinfo" NEXT="teacher"/>
44 <FIELD NAME="teacher" TYPE="char" LENGTH="100" NOTNULL="true" DEFAULT="Teacher" SEQUENCE="false" ENUM="false" PREVIOUS="newsitems" NEXT="teachers"/>
45 <FIELD NAME="teachers" TYPE="char" LENGTH="100" NOTNULL="true" DEFAULT="Teachers" SEQUENCE="false" ENUM="false" PREVIOUS="teacher" NEXT="student"/>
46 <FIELD NAME="student" TYPE="char" LENGTH="100" NOTNULL="true" DEFAULT="Student" SEQUENCE="false" ENUM="false" PREVIOUS="teachers" NEXT="students"/>
47 <FIELD NAME="students" TYPE="char" LENGTH="100" NOTNULL="true" DEFAULT="Students" SEQUENCE="false" ENUM="false" PREVIOUS="student" NEXT="guest"/>
48 <FIELD NAME="guest" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="students" NEXT="startdate"/>
49 <FIELD NAME="startdate" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="guest" NEXT="enrolperiod"/>
50 <FIELD NAME="enrolperiod" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="startdate" NEXT="numsections"/>
51 <FIELD NAME="numsections" TYPE="int" LENGTH="5" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="enrolperiod" NEXT="marker"/>
52 <FIELD NAME="marker" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="numsections" NEXT="maxbytes"/>
53 <FIELD NAME="maxbytes" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="marker" NEXT="showreports"/>
54 <FIELD NAME="showreports" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="maxbytes" NEXT="visible"/>
55 <FIELD NAME="visible" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="showreports" NEXT="hiddensections"/>
56 <FIELD NAME="hiddensections" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="visible" NEXT="groupmode"/>
57 <FIELD NAME="groupmode" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="hiddensections" NEXT="groupmodeforce"/>
58 <FIELD NAME="groupmodeforce" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="groupmode" NEXT="lang"/>
deb12ef4 59 <FIELD NAME="lang" TYPE="char" LENGTH="30" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="groupmodeforce" NEXT="theme"/>
67d7d694 60 <FIELD NAME="theme" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="lang" NEXT="cost"/>
61 <FIELD NAME="cost" TYPE="char" LENGTH="10" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="theme" NEXT="currency"/>
62 <FIELD NAME="currency" TYPE="char" LENGTH="3" NOTNULL="true" DEFAULT="USD" SEQUENCE="false" ENUM="false" PREVIOUS="cost" NEXT="timecreated"/>
63 <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="currency" NEXT="timemodified"/>
64 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timecreated" NEXT="metacourse"/>
65 <FIELD NAME="metacourse" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timemodified" NEXT="requested"/>
66 <FIELD NAME="requested" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="metacourse" NEXT="restrictmodules"/>
67 <FIELD NAME="restrictmodules" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="requested" NEXT="expirynotify"/>
68 <FIELD NAME="expirynotify" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="restrictmodules" NEXT="expirythreshold"/>
69 <FIELD NAME="expirythreshold" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="expirynotify" NEXT="notifystudents"/>
70 <FIELD NAME="notifystudents" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="expirythreshold" NEXT="enrollable"/>
71 <FIELD NAME="enrollable" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="notifystudents" NEXT="enrolstartdate"/>
72 <FIELD NAME="enrolstartdate" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="enrollable" NEXT="enrolenddate"/>
73 <FIELD NAME="enrolenddate" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="enrolstartdate" NEXT="enrol"/>
746a04c5 74 <FIELD NAME="enrol" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="enrolenddate" NEXT="defaultrole"/>
f4fc87e1 75 <FIELD NAME="defaultrole" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="The default role given to participants who self-enrol" PREVIOUS="enrol"/>
67d7d694 76 </FIELDS>
77 <KEYS>
78 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for course"/>
79 </KEYS>
80 <INDEXES>
81 <INDEX NAME="category" UNIQUE="false" FIELDS="category" NEXT="idnumber"/>
82 <INDEX NAME="idnumber" UNIQUE="false" FIELDS="idnumber" PREVIOUS="category" NEXT="shortname"/>
83 <INDEX NAME="shortname" UNIQUE="false" FIELDS="shortname" PREVIOUS="idnumber"/>
84 </INDEXES>
85 </TABLE>
86 <TABLE NAME="course_categories" COMMENT="Course categories" PREVIOUS="course" NEXT="course_display">
87 <FIELDS>
88 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="name"/>
89 <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="description"/>
1d39207f 90 <FIELD NAME="description" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="parent"/>
67d7d694 91 <FIELD NAME="parent" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="description" NEXT="sortorder"/>
92 <FIELD NAME="sortorder" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="parent" NEXT="coursecount"/>
93 <FIELD NAME="coursecount" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="sortorder" NEXT="visible"/>
94 <FIELD NAME="visible" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="coursecount" NEXT="timemodified"/>
95 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="visible" NEXT="depth"/>
96 <FIELD NAME="depth" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timemodified" NEXT="path"/>
ec75a182 97 <FIELD NAME="path" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="depth" NEXT="theme"/>
98 <FIELD NAME="theme" TYPE="char" LENGTH="50" NOTNULL="false" SEQUENCE="false" ENUM="false" COMMENT="Theme for the category" PREVIOUS="path"/>
67d7d694 99 </FIELDS>
100 <KEYS>
b08eda73 101 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for course_categories" NEXT="parent"/>
102 <KEY NAME="parent" TYPE="foreign" FIELDS="parent" REFTABLE="course_categories" REFFIELDS="id" COMMENT="note that to make this recursive FK working someday, the parent field must be declared NULL" PREVIOUS="primary"/>
67d7d694 103 </KEYS>
104 </TABLE>
105 <TABLE NAME="course_display" COMMENT="Stores info about how to display the course" PREVIOUS="course_categories" NEXT="course_meta">
106 <FIELDS>
107 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="course"/>
108 <FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="userid"/>
109 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="course" NEXT="display"/>
110 <FIELD NAME="display" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="userid"/>
111 </FIELDS>
112 <KEYS>
113 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for course_display"/>
114 </KEYS>
115 <INDEXES>
116 <INDEX NAME="course_userid" UNIQUE="false" FIELDS="course, userid"/>
117 </INDEXES>
118 </TABLE>
119 <TABLE NAME="course_meta" COMMENT="to store meta-courses relations" PREVIOUS="course_display" NEXT="course_modules">
120 <FIELDS>
121 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="parent_course"/>
122 <FIELD NAME="parent_course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="child_course"/>
123 <FIELD NAME="child_course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="parent_course"/>
124 </FIELDS>
125 <KEYS>
126 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for course_meta"/>
127 </KEYS>
128 <INDEXES>
129 <INDEX NAME="parent_course" UNIQUE="false" FIELDS="parent_course" NEXT="child_course"/>
130 <INDEX NAME="child_course" UNIQUE="false" FIELDS="child_course" PREVIOUS="parent_course"/>
131 </INDEXES>
132 </TABLE>
133 <TABLE NAME="course_modules" COMMENT="course_modules table retrofitted from MySQL" PREVIOUS="course_meta" NEXT="course_sections">
134 <FIELDS>
135 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="course"/>
136 <FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="module"/>
137 <FIELD NAME="module" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="course" NEXT="instance"/>
138 <FIELD NAME="instance" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="module" NEXT="section"/>
177d4abf 139 <FIELD NAME="section" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="instance" NEXT="idnumber"/>
140 <FIELD NAME="idnumber" TYPE="char" LENGTH="100" NOTNULL="false" SEQUENCE="false" ENUM="false" COMMENT="customizable idnumber" PREVIOUS="section" NEXT="added"/>
141 <FIELD NAME="added" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="idnumber" NEXT="score"/>
67d7d694 142 <FIELD NAME="score" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="added" NEXT="indent"/>
143 <FIELD NAME="indent" TYPE="int" LENGTH="5" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="score" NEXT="visible"/>
144 <FIELD NAME="visible" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="indent" NEXT="visibleold"/>
145 <FIELD NAME="visibleold" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="visible" NEXT="groupmode"/>
146 <FIELD NAME="groupmode" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="visibleold"/>
147 </FIELDS>
148 <KEYS>
149 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for course_modules"/>
150 </KEYS>
151 <INDEXES>
152 <INDEX NAME="visible" UNIQUE="false" FIELDS="visible" NEXT="course"/>
153 <INDEX NAME="course" UNIQUE="false" FIELDS="course" PREVIOUS="visible" NEXT="module"/>
154 <INDEX NAME="module" UNIQUE="false" FIELDS="module" PREVIOUS="course" NEXT="instance"/>
177d4abf 155 <INDEX NAME="instance" UNIQUE="false" FIELDS="instance" PREVIOUS="module" NEXT="idnumber"/>
156 <INDEX NAME="idnumber" UNIQUE="true" FIELDS="idnumber" COMMENT="Default comment for the index, please edit me" PREVIOUS="instance"/>
67d7d694 157 </INDEXES>
158 </TABLE>
159 <TABLE NAME="course_sections" COMMENT="to define the sections for each course" PREVIOUS="course_modules" NEXT="course_request">
160 <FIELDS>
161 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="course"/>
162 <FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="section"/>
163 <FIELD NAME="section" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="course" NEXT="summary"/>
13317458 164 <FIELD NAME="summary" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" ENUM="false" PREVIOUS="section" NEXT="sequence"/>
165 <FIELD NAME="sequence" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" ENUM="false" PREVIOUS="summary" NEXT="visible"/>
67d7d694 166 <FIELD NAME="visible" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="sequence"/>
167 </FIELDS>
168 <KEYS>
169 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for course_sections"/>
170 </KEYS>
171 <INDEXES>
172 <INDEX NAME="course_section" UNIQUE="false" FIELDS="course, section"/>
173 </INDEXES>
174 </TABLE>
175 <TABLE NAME="course_request" COMMENT="course requests" PREVIOUS="course_sections" NEXT="course_allowed_modules">
176 <FIELDS>
177 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="fullname"/>
178 <FIELD NAME="fullname" TYPE="char" LENGTH="254" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="shortname"/>
179 <FIELD NAME="shortname" TYPE="char" LENGTH="15" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="fullname" NEXT="summary"/>
180 <FIELD NAME="summary" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="shortname" NEXT="reason"/>
181 <FIELD NAME="reason" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="summary" NEXT="requester"/>
182 <FIELD NAME="requester" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="reason" NEXT="password"/>
183 <FIELD NAME="password" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="requester"/>
184 </FIELDS>
185 <KEYS>
186 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for course_request"/>
187 </KEYS>
188 <INDEXES>
189 <INDEX NAME="shortname" UNIQUE="false" FIELDS="shortname"/>
190 </INDEXES>
191 </TABLE>
192 <TABLE NAME="course_allowed_modules" COMMENT="allowed modules foreach course" PREVIOUS="course_request" NEXT="event">
193 <FIELDS>
194 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="course"/>
195 <FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="module"/>
196 <FIELD NAME="module" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="course"/>
197 </FIELDS>
198 <KEYS>
199 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for course_allowed_modules"/>
200 </KEYS>
201 <INDEXES>
202 <INDEX NAME="course" UNIQUE="false" FIELDS="course" NEXT="module"/>
203 <INDEX NAME="module" UNIQUE="false" FIELDS="module" PREVIOUS="course"/>
204 </INDEXES>
205 </TABLE>
206 <TABLE NAME="event" COMMENT="For everything with a time associated to it" PREVIOUS="course_allowed_modules" NEXT="cache_filters">
207 <FIELDS>
208 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="name"/>
209 <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="description"/>
210 <FIELD NAME="description" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="format"/>
211 <FIELD NAME="format" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="description" NEXT="courseid"/>
212 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="format" NEXT="groupid"/>
213 <FIELD NAME="groupid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="courseid" NEXT="userid"/>
214 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="groupid" NEXT="repeatid"/>
215 <FIELD NAME="repeatid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="modulename"/>
216 <FIELD NAME="modulename" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="repeatid" NEXT="instance"/>
217 <FIELD NAME="instance" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="modulename" NEXT="eventtype"/>
218 <FIELD NAME="eventtype" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="instance" NEXT="timestart"/>
219 <FIELD NAME="timestart" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="eventtype" NEXT="timeduration"/>
220 <FIELD NAME="timeduration" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timestart" NEXT="visible"/>
221 <FIELD NAME="visible" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="false" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="timeduration" NEXT="uuid"/>
222 <FIELD NAME="uuid" TYPE="char" LENGTH="36" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="visible" NEXT="sequence"/>
223 <FIELD NAME="sequence" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="uuid" NEXT="timemodified"/>
224 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="sequence"/>
225 </FIELDS>
226 <KEYS>
227 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for event"/>
228 </KEYS>
229 <INDEXES>
230 <INDEX NAME="courseid" UNIQUE="false" FIELDS="courseid" NEXT="userid"/>
231 <INDEX NAME="userid" UNIQUE="false" FIELDS="userid" PREVIOUS="courseid" NEXT="timestart"/>
232 <INDEX NAME="timestart" UNIQUE="false" FIELDS="timestart" PREVIOUS="userid" NEXT="timeduration"/>
233 <INDEX NAME="timeduration" UNIQUE="false" FIELDS="timeduration" PREVIOUS="timestart"/>
234 </INDEXES>
235 </TABLE>
236 <TABLE NAME="cache_filters" COMMENT="For keeping information about cached data" PREVIOUS="event" NEXT="cache_text">
237 <FIELDS>
238 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="filter"/>
239 <FIELD NAME="filter" TYPE="char" LENGTH="32" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="version"/>
240 <FIELD NAME="version" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="filter" NEXT="md5key"/>
241 <FIELD NAME="md5key" TYPE="char" LENGTH="32" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="version" NEXT="rawtext"/>
242 <FIELD NAME="rawtext" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="md5key" NEXT="timemodified"/>
243 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="rawtext"/>
244 </FIELDS>
245 <KEYS>
246 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for cache_filters"/>
247 </KEYS>
248 <INDEXES>
249 <INDEX NAME="filter_md5key" UNIQUE="false" FIELDS="filter, md5key"/>
250 </INDEXES>
251 </TABLE>
252 <TABLE NAME="cache_text" COMMENT="For storing temporary copies of processed texts" PREVIOUS="cache_filters" NEXT="grade_category">
253 <FIELDS>
254 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="md5key"/>
255 <FIELD NAME="md5key" TYPE="char" LENGTH="32" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="formattedtext"/>
0e1412ce 256 <FIELD NAME="formattedtext" TYPE="text" LENGTH="big" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="md5key" NEXT="timemodified"/>
67d7d694 257 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="formattedtext"/>
258 </FIELDS>
259 <KEYS>
260 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for cache_text"/>
261 </KEYS>
262 <INDEXES>
263 <INDEX NAME="md5key" UNIQUE="false" FIELDS="md5key"/>
264 </INDEXES>
265 </TABLE>
266 <TABLE NAME="grade_category" COMMENT="to define categories to group activity grades" PREVIOUS="cache_text" NEXT="grade_exceptions">
267 <FIELDS>
268 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="name"/>
269 <FIELD NAME="name" TYPE="char" LENGTH="64" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="courseid"/>
270 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="drop_x_lowest"/>
271 <FIELD NAME="drop_x_lowest" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="courseid" NEXT="bonus_points"/>
272 <FIELD NAME="bonus_points" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="drop_x_lowest" NEXT="hidden"/>
273 <FIELD NAME="hidden" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="bonus_points" NEXT="weight"/>
274 <FIELD NAME="weight" TYPE="number" LENGTH="5" NOTNULL="true" UNSIGNED="false" DEFAULT="0.00" SEQUENCE="false" ENUM="false" DECIMALS="2" PREVIOUS="hidden"/>
275 </FIELDS>
276 <KEYS>
277 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for grade_category"/>
278 </KEYS>
279 <INDEXES>
280 <INDEX NAME="courseid" UNIQUE="false" FIELDS="courseid"/>
281 </INDEXES>
282 </TABLE>
283 <TABLE NAME="grade_exceptions" COMMENT="individual grades to be skipped for certain students" PREVIOUS="grade_category" NEXT="grade_item">
284 <FIELDS>
285 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="courseid"/>
286 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="grade_itemid"/>
287 <FIELD NAME="grade_itemid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="courseid" NEXT="userid"/>
288 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="grade_itemid"/>
289 </FIELDS>
290 <KEYS>
291 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for grade_exceptions"/>
292 </KEYS>
293 <INDEXES>
294 <INDEX NAME="courseid" UNIQUE="false" FIELDS="courseid"/>
295 </INDEXES>
296 </TABLE>
297 <TABLE NAME="grade_item" COMMENT="items to be graded" PREVIOUS="grade_exceptions" NEXT="grade_letter">
298 <FIELDS>
299 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="courseid"/>
300 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="category"/>
301 <FIELD NAME="category" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="courseid" NEXT="modid"/>
302 <FIELD NAME="modid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="category" NEXT="cminstance"/>
303 <FIELD NAME="cminstance" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="modid" NEXT="scale_grade"/>
304 <FIELD NAME="scale_grade" TYPE="float" LENGTH="11" NOTNULL="true" UNSIGNED="false" DEFAULT="1.0000000000" SEQUENCE="false" ENUM="false" DECIMALS="10" PREVIOUS="cminstance" NEXT="extra_credit"/>
305 <FIELD NAME="extra_credit" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="scale_grade" NEXT="sort_order"/>
306 <FIELD NAME="sort_order" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="extra_credit"/>
307 </FIELDS>
308 <KEYS>
309 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for grade_item"/>
310 </KEYS>
311 <INDEXES>
312 <INDEX NAME="courseid" UNIQUE="false" FIELDS="courseid"/>
313 </INDEXES>
314 </TABLE>
315 <TABLE NAME="grade_letter" COMMENT="to convert numerical grades to letter grades" PREVIOUS="grade_item" NEXT="grade_preferences">
316 <FIELDS>
317 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="courseid"/>
318 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="letter"/>
319 <FIELD NAME="letter" TYPE="char" LENGTH="8" NOTNULL="true" DEFAULT="NA" SEQUENCE="false" ENUM="false" PREVIOUS="courseid" NEXT="grade_high"/>
320 <FIELD NAME="grade_high" TYPE="number" LENGTH="5" NOTNULL="true" UNSIGNED="false" DEFAULT="100.00" SEQUENCE="false" ENUM="false" DECIMALS="2" PREVIOUS="letter" NEXT="grade_low"/>
321 <FIELD NAME="grade_low" TYPE="number" LENGTH="5" NOTNULL="true" UNSIGNED="false" DEFAULT="0.00" SEQUENCE="false" ENUM="false" DECIMALS="2" PREVIOUS="grade_high"/>
322 </FIELDS>
323 <KEYS>
324 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for grade_letter"/>
325 </KEYS>
326 <INDEXES>
327 <INDEX NAME="courseid" UNIQUE="false" FIELDS="courseid"/>
328 </INDEXES>
329 </TABLE>
f3f7610c 330 <TABLE NAME="grade_preferences" COMMENT="Preferences of the gradebook for each course" PREVIOUS="grade_letter" NEXT="log">
67d7d694 331 <FIELDS>
332 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="courseid"/>
333 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="preference"/>
334 <FIELD NAME="preference" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="courseid" NEXT="value"/>
335 <FIELD NAME="value" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="preference"/>
336 </FIELDS>
337 <KEYS>
338 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for grade_preferences"/>
339 </KEYS>
340 <INDEXES>
341 <INDEX NAME="courseid-preference" UNIQUE="true" FIELDS="courseid, preference"/>
342 </INDEXES>
343 </TABLE>
f3f7610c 344 <TABLE NAME="log" COMMENT="Every action is logged as far as possible" PREVIOUS="grade_preferences" NEXT="log_display">
67d7d694 345 <FIELDS>
346 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="time"/>
347 <FIELD NAME="time" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="userid"/>
348 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="time" NEXT="ip"/>
349 <FIELD NAME="ip" TYPE="char" LENGTH="15" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="course"/>
350 <FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="ip" NEXT="module"/>
351 <FIELD NAME="module" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="course" NEXT="cmid"/>
352 <FIELD NAME="cmid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="module" NEXT="action"/>
353 <FIELD NAME="action" TYPE="char" LENGTH="40" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="cmid" NEXT="url"/>
354 <FIELD NAME="url" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="action" NEXT="info"/>
355 <FIELD NAME="info" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="url"/>
356 </FIELDS>
357 <KEYS>
358 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for log"/>
359 </KEYS>
360 <INDEXES>
361 <INDEX NAME="time-course-module-action" UNIQUE="false" FIELDS="time, course, module, action" NEXT="course-module-action"/>
362 <INDEX NAME="course-module-action" UNIQUE="false" FIELDS="course, module, action" PREVIOUS="time-course-module-action" NEXT="course-userid"/>
363 <INDEX NAME="course-userid" UNIQUE="false" FIELDS="course, userid" PREVIOUS="course-module-action" NEXT="userid"/>
364 <INDEX NAME="userid" UNIQUE="false" FIELDS="userid" PREVIOUS="course-userid" NEXT="info"/>
365 <INDEX NAME="info" UNIQUE="false" FIELDS="info" PREVIOUS="userid"/>
366 </INDEXES>
367 </TABLE>
368 <TABLE NAME="log_display" COMMENT="For a particular module/action, specifies a moodle table/field" PREVIOUS="log" NEXT="message">
369 <FIELDS>
370 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="module"/>
371 <FIELD NAME="module" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="action"/>
372 <FIELD NAME="action" TYPE="char" LENGTH="40" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="module" NEXT="mtable"/>
373 <FIELD NAME="mtable" TYPE="char" LENGTH="30" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="action" NEXT="field"/>
2efd67bf 374 <FIELD NAME="field" TYPE="char" LENGTH="200" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="mtable"/>
67d7d694 375 </FIELDS>
376 <KEYS>
377 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for log_display"/>
378 </KEYS>
379 <INDEXES>
380 <INDEX NAME="module-action" UNIQUE="true" FIELDS="module, action"/>
381 </INDEXES>
382 </TABLE>
383 <TABLE NAME="message" COMMENT="Stores all unread messages" PREVIOUS="log_display" NEXT="message_read">
384 <FIELDS>
385 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="useridfrom"/>
386 <FIELD NAME="useridfrom" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="useridto"/>
387 <FIELD NAME="useridto" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="useridfrom" NEXT="message"/>
388 <FIELD NAME="message" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="useridto" NEXT="format"/>
389 <FIELD NAME="format" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="message" NEXT="timecreated"/>
390 <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="format" NEXT="messagetype"/>
391 <FIELD NAME="messagetype" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="timecreated"/>
392 </FIELDS>
393 <KEYS>
394 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for message"/>
395 </KEYS>
396 <INDEXES>
397 <INDEX NAME="useridfrom" UNIQUE="false" FIELDS="useridfrom" NEXT="useridto"/>
398 <INDEX NAME="useridto" UNIQUE="false" FIELDS="useridto" PREVIOUS="useridfrom"/>
399 </INDEXES>
400 </TABLE>
401 <TABLE NAME="message_read" COMMENT="Stores all messages that have been read" PREVIOUS="message" NEXT="message_contacts">
402 <FIELDS>
403 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="useridfrom"/>
404 <FIELD NAME="useridfrom" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="useridto"/>
405 <FIELD NAME="useridto" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="useridfrom" NEXT="message"/>
406 <FIELD NAME="message" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="useridto" NEXT="format"/>
407 <FIELD NAME="format" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="message" NEXT="timecreated"/>
408 <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="format" NEXT="timeread"/>
409 <FIELD NAME="timeread" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timecreated" NEXT="messagetype"/>
410 <FIELD NAME="messagetype" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="timeread" NEXT="mailed"/>
411 <FIELD NAME="mailed" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="messagetype"/>
412 </FIELDS>
413 <KEYS>
414 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for message_read"/>
415 </KEYS>
416 <INDEXES>
417 <INDEX NAME="useridfrom" UNIQUE="false" FIELDS="useridfrom" NEXT="useridto"/>
418 <INDEX NAME="useridto" UNIQUE="false" FIELDS="useridto" PREVIOUS="useridfrom"/>
419 </INDEXES>
420 </TABLE>
421 <TABLE NAME="message_contacts" COMMENT="Maintains lists of relationships between users" PREVIOUS="message_read" NEXT="modules">
422 <FIELDS>
423 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="userid"/>
424 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="contactid"/>
425 <FIELD NAME="contactid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="blocked"/>
426 <FIELD NAME="blocked" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="contactid"/>
427 </FIELDS>
428 <KEYS>
429 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for message_contacts"/>
430 </KEYS>
431 <INDEXES>
432 <INDEX NAME="userid-contactid" UNIQUE="true" FIELDS="userid, contactid"/>
433 </INDEXES>
434 </TABLE>
435 <TABLE NAME="modules" COMMENT="modules available in the site" PREVIOUS="message_contacts" NEXT="scale">
436 <FIELDS>
437 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="name"/>
438 <FIELD NAME="name" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="version"/>
439 <FIELD NAME="version" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="cron"/>
440 <FIELD NAME="cron" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="version" NEXT="lastcron"/>
441 <FIELD NAME="lastcron" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="cron" NEXT="search"/>
442 <FIELD NAME="search" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="lastcron" NEXT="visible"/>
443 <FIELD NAME="visible" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="search"/>
444 </FIELDS>
445 <KEYS>
446 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for modules"/>
447 </KEYS>
448 <INDEXES>
449 <INDEX NAME="name" UNIQUE="false" FIELDS="name"/>
450 </INDEXES>
451 </TABLE>
647a2566 452 <TABLE NAME="scale" COMMENT="Defines grading scales" PREVIOUS="modules" NEXT="sessions2">
67d7d694 453 <FIELDS>
454 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="courseid"/>
455 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="userid"/>
456 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="courseid" NEXT="name"/>
457 <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="scale"/>
458 <FIELD NAME="scale" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="description"/>
459 <FIELD NAME="description" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="scale" NEXT="timemodified"/>
460 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="description"/>
461 </FIELDS>
462 <KEYS>
463 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for scale"/>
464 </KEYS>
465 <INDEXES>
466 <INDEX NAME="courseid" UNIQUE="false" FIELDS="courseid"/>
467 </INDEXES>
468 </TABLE>
415280bf 469 <TABLE NAME="sessions2" COMMENT="Optional database session storage in new format, not used by default" PREVIOUS="scale" NEXT="adodb_logsql">
67d7d694 470 <FIELDS>
647a2566 471 <FIELD NAME="sesskey" TYPE="char" LENGTH="64" NOTNULL="true" SEQUENCE="false" ENUM="false" NEXT="expiry"/>
472 <FIELD NAME="expiry" TYPE="datetime" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="sesskey" NEXT="expireref"/>
473 <FIELD NAME="expireref" TYPE="char" LENGTH="250" NOTNULL="false" DEFAULT="" SEQUENCE="false" ENUM="false" PREVIOUS="expiry" NEXT="created"/>
474 <FIELD NAME="created" TYPE="datetime" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="expireref" NEXT="modified"/>
475 <FIELD NAME="modified" TYPE="datetime" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="created" NEXT="sessdata"/>
eb2658e0 476 <FIELD NAME="sessdata" TYPE="text" LENGTH="big" NOTNULL="false" DEFAULT="" SEQUENCE="false" ENUM="false" PREVIOUS="modified"/>
67d7d694 477 </FIELDS>
478 <KEYS>
479 <KEY NAME="primary" TYPE="primary" FIELDS="sesskey" COMMENT="Primary key for sessions"/>
480 </KEYS>
481 <INDEXES>
81465066 482 <INDEX NAME="expiry" UNIQUE="false" FIELDS="expiry" NEXT="expireref"/>
483 <INDEX NAME="expireref" UNIQUE="false" FIELDS="expireref" PREVIOUS="expiry"/>
67d7d694 484 </INDEXES>
485 </TABLE>
415280bf 486 <TABLE NAME="adodb_logsql" COMMENT="to save some logs from ADOdb" PREVIOUS="sessions2" NEXT="timezone">
487 <FIELDS>
488 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="created"/>
489 <FIELD NAME="created" TYPE="datetime" LENGTH="2" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="sql0"/>
490 <FIELD NAME="sql0" TYPE="char" LENGTH="250" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="created" NEXT="sql1"/>
491 <FIELD NAME="sql1" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" ENUM="false" PREVIOUS="sql0" NEXT="params"/>
492 <FIELD NAME="params" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" ENUM="false" PREVIOUS="sql1" NEXT="tracer"/>
493 <FIELD NAME="tracer" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" ENUM="false" PREVIOUS="params" NEXT="timer"/>
494 <FIELD NAME="timer" TYPE="number" LENGTH="16" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" DECIMALS="6" PREVIOUS="tracer"/>
495 </FIELDS>
496 <KEYS>
497 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
498 </KEYS>
499 </TABLE>
500 <TABLE NAME="timezone" COMMENT="Rules for calculating local wall clock time for users" PREVIOUS="adodb_logsql" NEXT="user">
67d7d694 501 <FIELDS>
502 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="true" ENUM="false" NEXT="name"/>
503 <FIELD NAME="name" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="year"/>
598dc3a9 504 <FIELD NAME="year" TYPE="int" LENGTH="11" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="tzrule"/>
505 <FIELD NAME="tzrule" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="year" NEXT="gmtoff"/>
506 <FIELD NAME="gmtoff" TYPE="int" LENGTH="11" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="tzrule" NEXT="dstoff"/>
67d7d694 507 <FIELD NAME="dstoff" TYPE="int" LENGTH="11" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="gmtoff" NEXT="dst_month"/>
508 <FIELD NAME="dst_month" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="dstoff" NEXT="dst_startday"/>
509 <FIELD NAME="dst_startday" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="dst_month" NEXT="dst_weekday"/>
510 <FIELD NAME="dst_weekday" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="dst_startday" NEXT="dst_skipweeks"/>
511 <FIELD NAME="dst_skipweeks" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="dst_weekday" NEXT="dst_time"/>
512 <FIELD NAME="dst_time" TYPE="char" LENGTH="5" NOTNULL="true" DEFAULT="00:00" SEQUENCE="false" ENUM="false" PREVIOUS="dst_skipweeks" NEXT="std_month"/>
513 <FIELD NAME="std_month" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="dst_time" NEXT="std_startday"/>
514 <FIELD NAME="std_startday" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="std_month" NEXT="std_weekday"/>
515 <FIELD NAME="std_weekday" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="std_startday" NEXT="std_skipweeks"/>
516 <FIELD NAME="std_skipweeks" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="std_weekday" NEXT="std_time"/>
517 <FIELD NAME="std_time" TYPE="char" LENGTH="5" NOTNULL="true" DEFAULT="00:00" SEQUENCE="false" ENUM="false" PREVIOUS="std_skipweeks"/>
518 </FIELDS>
519 <KEYS>
520 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for timezone"/>
521 </KEYS>
522 </TABLE>
04338f9e 523 <TABLE NAME="user" COMMENT="One record for each person" PREVIOUS="timezone" NEXT="user_preferences">
67d7d694 524 <FIELDS>
525 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="auth"/>
526 <FIELD NAME="auth" TYPE="char" LENGTH="20" NOTNULL="true" DEFAULT="manual" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="confirmed"/>
527 <FIELD NAME="confirmed" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="auth" NEXT="policyagreed"/>
528 <FIELD NAME="policyagreed" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="confirmed" NEXT="deleted"/>
9654f633 529 <FIELD NAME="deleted" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="policyagreed" NEXT="mnethostid"/>
0db6adc9 530 <FIELD NAME="mnethostid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="deleted" NEXT="username"/>
9654f633 531 <FIELD NAME="username" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="mnethostid" NEXT="password"/>
67d7d694 532 <FIELD NAME="password" TYPE="char" LENGTH="32" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="username" NEXT="idnumber"/>
533 <FIELD NAME="idnumber" TYPE="char" LENGTH="64" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="password" NEXT="firstname"/>
534 <FIELD NAME="firstname" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="idnumber" NEXT="lastname"/>
535 <FIELD NAME="lastname" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="firstname" NEXT="email"/>
536 <FIELD NAME="email" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="lastname" NEXT="emailstop"/>
537 <FIELD NAME="emailstop" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="email" NEXT="icq"/>
538 <FIELD NAME="icq" TYPE="char" LENGTH="15" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="emailstop" NEXT="skype"/>
539 <FIELD NAME="skype" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="icq" NEXT="yahoo"/>
540 <FIELD NAME="yahoo" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="skype" NEXT="aim"/>
541 <FIELD NAME="aim" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="yahoo" NEXT="msn"/>
542 <FIELD NAME="msn" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="aim" NEXT="phone1"/>
543 <FIELD NAME="phone1" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="msn" NEXT="phone2"/>
544 <FIELD NAME="phone2" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="phone1" NEXT="institution"/>
545 <FIELD NAME="institution" TYPE="char" LENGTH="40" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="phone2" NEXT="department"/>
546 <FIELD NAME="department" TYPE="char" LENGTH="30" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="institution" NEXT="address"/>
547 <FIELD NAME="address" TYPE="char" LENGTH="70" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="department" NEXT="city"/>
548 <FIELD NAME="city" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="address" NEXT="country"/>
549 <FIELD NAME="country" TYPE="char" LENGTH="2" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="city" NEXT="lang"/>
deb12ef4 550 <FIELD NAME="lang" TYPE="char" LENGTH="30" NOTNULL="true" DEFAULT="en" SEQUENCE="false" ENUM="false" PREVIOUS="country" NEXT="theme"/>
67d7d694 551 <FIELD NAME="theme" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="lang" NEXT="timezone"/>
552 <FIELD NAME="timezone" TYPE="char" LENGTH="100" NOTNULL="true" DEFAULT="99" SEQUENCE="false" ENUM="false" PREVIOUS="theme" NEXT="firstaccess"/>
553 <FIELD NAME="firstaccess" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timezone" NEXT="lastaccess"/>
554 <FIELD NAME="lastaccess" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="firstaccess" NEXT="lastlogin"/>
555 <FIELD NAME="lastlogin" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="lastaccess" NEXT="currentlogin"/>
556 <FIELD NAME="currentlogin" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="lastlogin" NEXT="lastip"/>
557 <FIELD NAME="lastip" TYPE="char" LENGTH="15" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="currentlogin" NEXT="secret"/>
558 <FIELD NAME="secret" TYPE="char" LENGTH="15" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="lastip" NEXT="picture"/>
559 <FIELD NAME="picture" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="secret" NEXT="url"/>
560 <FIELD NAME="url" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="picture" NEXT="description"/>
9b99c05f 561 <FIELD NAME="description" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" ENUM="false" PREVIOUS="url" NEXT="mailformat"/>
67d7d694 562 <FIELD NAME="mailformat" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="description" NEXT="maildigest"/>
563 <FIELD NAME="maildigest" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="mailformat" NEXT="maildisplay"/>
564 <FIELD NAME="maildisplay" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="2" SEQUENCE="false" ENUM="false" PREVIOUS="maildigest" NEXT="htmleditor"/>
67a3fac5 565 <FIELD NAME="htmleditor" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="maildisplay" NEXT="ajax"/>
566 <FIELD NAME="ajax" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="htmleditor" NEXT="autosubscribe"/>
b477a2f1 567 <FIELD NAME="autosubscribe" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="ajax" NEXT="trackforums"/>
67d7d694 568 <FIELD NAME="trackforums" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="autosubscribe" NEXT="timemodified"/>
25d8040e 569 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="trackforums" NEXT="trustbitmask"/>
54dc87b8 570 <FIELD NAME="trustbitmask" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timemodified" NEXT="imagealt"/>
571 <FIELD NAME="imagealt" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" ENUM="false" COMMENT="alt tag for user uploaded image" PREVIOUS="trustbitmask" NEXT="screenreader"/>
572 <FIELD NAME="screenreader" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="flag for determining whehter the user uses a screenreader." PREVIOUS="imagealt"/>
67d7d694 573 </FIELDS>
574 <KEYS>
575 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for user"/>
576 </KEYS>
577 <INDEXES>
9654f633 578 <INDEX NAME="username" UNIQUE="true" FIELDS="mnethostid, username" NEXT="deleted"/>
67d7d694 579 <INDEX NAME="deleted" UNIQUE="false" FIELDS="deleted" PREVIOUS="username" NEXT="confirmed"/>
580 <INDEX NAME="confirmed" UNIQUE="false" FIELDS="confirmed" PREVIOUS="deleted" NEXT="firstname"/>
581 <INDEX NAME="firstname" UNIQUE="false" FIELDS="firstname" PREVIOUS="confirmed" NEXT="lastname"/>
582 <INDEX NAME="lastname" UNIQUE="false" FIELDS="lastname" PREVIOUS="firstname" NEXT="city"/>
583 <INDEX NAME="city" UNIQUE="false" FIELDS="city" PREVIOUS="lastname" NEXT="country"/>
584 <INDEX NAME="country" UNIQUE="false" FIELDS="country" PREVIOUS="city" NEXT="lastaccess"/>
585 <INDEX NAME="lastaccess" UNIQUE="false" FIELDS="lastaccess" PREVIOUS="country" NEXT="email"/>
586 <INDEX NAME="email" UNIQUE="false" FIELDS="email" PREVIOUS="lastaccess" NEXT="auth"/>
587 <INDEX NAME="auth" UNIQUE="false" FIELDS="auth" PREVIOUS="email" NEXT="idnumber"/>
588 <INDEX NAME="idnumber" UNIQUE="false" FIELDS="idnumber" PREVIOUS="auth"/>
589 </INDEXES>
590 </TABLE>
04338f9e 591 <TABLE NAME="user_preferences" COMMENT="Allows modules to store arbitrary user preferences" PREVIOUS="user" NEXT="user_lastaccess">
67d7d694 592 <FIELDS>
593 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="userid"/>
594 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="name"/>
595 <FIELD NAME="name" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="value"/>
596 <FIELD NAME="value" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="name"/>
597 </FIELDS>
598 <KEYS>
599 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for user_preferences"/>
600 </KEYS>
601 <INDEXES>
602 <INDEX NAME="userid-name" UNIQUE="true" FIELDS="userid, name"/>
603 </INDEXES>
604 </TABLE>
04338f9e 605 <TABLE NAME="user_lastaccess" COMMENT="To keep track of course page access times, used in online participants block, and participants list" PREVIOUS="user_preferences" NEXT="stats_daily">
8b9b5109 606 <FIELDS>
607 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="userid"/>
608 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="courseid"/>
609 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="timeaccess"/>
610 <FIELD NAME="timeaccess" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="courseid"/>
611 </FIELDS>
612 <KEYS>
613 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for user_lastaccess"/>
614 </KEYS>
615 <INDEXES>
616 <INDEX NAME="userid-courseid" UNIQUE="true" FIELDS="userid, courseid" NEXT="userid"/>
617 <INDEX NAME="userid" UNIQUE="false" FIELDS="userid" PREVIOUS="userid-courseid" NEXT="courseid"/>
618 <INDEX NAME="courseid" UNIQUE="false" FIELDS="courseid" PREVIOUS="userid"/>
619 </INDEXES>
620 </TABLE>
621 <TABLE NAME="stats_daily" COMMENT="to accumulate daily stats" PREVIOUS="user_lastaccess" NEXT="stats_weekly">
67d7d694 622 <FIELDS>
623 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="courseid"/>
624 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="timeend"/>
504e6fd4 625 <FIELD NAME="timeend" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="courseid" NEXT="roleid"/>
626 <FIELD NAME="roleid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="id of role for the aggregates" PREVIOUS="timeend" NEXT="stattype"/>
627 <FIELD NAME="stattype" TYPE="char" LENGTH="20" NOTNULL="true" DEFAULT="activity" SEQUENCE="false" ENUM="true" ENUMVALUES="'enrolments', 'activity', 'logins'" COMMENT="type of stat" PREVIOUS="roleid" NEXT="stat1"/>
628 <FIELD NAME="stat1" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="stat1. usually used for reads" PREVIOUS="stattype" NEXT="stat2"/>
629 <FIELD NAME="stat2" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="stat2. usually used for writes." PREVIOUS="stat1"/>
67d7d694 630 </FIELDS>
631 <KEYS>
632 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for stats_daily"/>
633 </KEYS>
634 <INDEXES>
635 <INDEX NAME="courseid" UNIQUE="false" FIELDS="courseid" NEXT="timeend"/>
504e6fd4 636 <INDEX NAME="timeend" UNIQUE="false" FIELDS="timeend" PREVIOUS="courseid" NEXT="roleid"/>
637 <INDEX NAME="roleid" UNIQUE="false" FIELDS="roleid" PREVIOUS="timeend"/>
67d7d694 638 </INDEXES>
639 </TABLE>
640 <TABLE NAME="stats_weekly" COMMENT="To accumulate weekly stats" PREVIOUS="stats_daily" NEXT="stats_monthly">
641 <FIELDS>
642 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="courseid"/>
643 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="timeend"/>
504e6fd4 644 <FIELD NAME="timeend" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="courseid" NEXT="roleid"/>
645 <FIELD NAME="roleid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="id of role for the aggregates" PREVIOUS="timeend" NEXT="stattype"/>
646 <FIELD NAME="stattype" TYPE="char" LENGTH="20" NOTNULL="true" DEFAULT="activity" SEQUENCE="false" ENUM="true" ENUMVALUES="'enrolments', 'activity', 'logins'" COMMENT="type of stat" PREVIOUS="roleid" NEXT="stat1"/>
647 <FIELD NAME="stat1" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="stat1. usually used for reads" PREVIOUS="stattype" NEXT="stat2"/>
648 <FIELD NAME="stat2" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="stat2. usually used for writes." PREVIOUS="stat1"/>
67d7d694 649 </FIELDS>
650 <KEYS>
651 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for stats_weekly"/>
652 </KEYS>
653 <INDEXES>
654 <INDEX NAME="courseid" UNIQUE="false" FIELDS="courseid" NEXT="timeend"/>
504e6fd4 655 <INDEX NAME="timeend" UNIQUE="false" FIELDS="timeend" PREVIOUS="courseid" NEXT="roleid"/>
656 <INDEX NAME="roleid" UNIQUE="false" FIELDS="roleid" PREVIOUS="timeend"/>
67d7d694 657 </INDEXES>
658 </TABLE>
659 <TABLE NAME="stats_monthly" COMMENT="To accumulate monthly stats" PREVIOUS="stats_weekly" NEXT="stats_user_daily">
660 <FIELDS>
661 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="courseid"/>
662 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="timeend"/>
504e6fd4 663 <FIELD NAME="timeend" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="courseid" NEXT="roleid"/>
664 <FIELD NAME="roleid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="id of role for the aggregates" PREVIOUS="timeend" NEXT="stattype"/>
665 <FIELD NAME="stattype" TYPE="char" LENGTH="20" NOTNULL="true" DEFAULT="activity" SEQUENCE="false" ENUM="true" ENUMVALUES="'enrolments', 'activity', 'logins'" COMMENT="type of stat" PREVIOUS="roleid" NEXT="stat1"/>
666 <FIELD NAME="stat1" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="stat1. usually used for reads" PREVIOUS="stattype" NEXT="stat2"/>
667 <FIELD NAME="stat2" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="stat2. usually used for writes." PREVIOUS="stat1"/>
67d7d694 668 </FIELDS>
669 <KEYS>
670 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for stats_monthly"/>
671 </KEYS>
672 <INDEXES>
673 <INDEX NAME="courseid" UNIQUE="false" FIELDS="courseid" NEXT="timeend"/>
504e6fd4 674 <INDEX NAME="timeend" UNIQUE="false" FIELDS="timeend" PREVIOUS="courseid" NEXT="roleid"/>
675 <INDEX NAME="roleid" UNIQUE="false" FIELDS="roleid" PREVIOUS="timeend"/>
67d7d694 676 </INDEXES>
677 </TABLE>
678 <TABLE NAME="stats_user_daily" COMMENT="To accumulate daily stats per course/user" PREVIOUS="stats_monthly" NEXT="stats_user_weekly">
679 <FIELDS>
680 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="courseid"/>
681 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="userid"/>
682 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="courseid" NEXT="roleid"/>
683 <FIELD NAME="roleid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="timeend"/>
684 <FIELD NAME="timeend" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="roleid" NEXT="statsreads"/>
685 <FIELD NAME="statsreads" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timeend" NEXT="statswrites"/>
686 <FIELD NAME="statswrites" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="statsreads" NEXT="stattype"/>
687 <FIELD NAME="stattype" TYPE="char" LENGTH="30" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="statswrites"/>
688 </FIELDS>
689 <KEYS>
690 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for stats_user_daily"/>
691 </KEYS>
692 <INDEXES>
693 <INDEX NAME="courseid" UNIQUE="false" FIELDS="courseid" NEXT="userid"/>
694 <INDEX NAME="userid" UNIQUE="false" FIELDS="userid" PREVIOUS="courseid" NEXT="roleid"/>
695 <INDEX NAME="roleid" UNIQUE="false" FIELDS="roleid" PREVIOUS="userid" NEXT="timeend"/>
696 <INDEX NAME="timeend" UNIQUE="false" FIELDS="timeend" PREVIOUS="roleid"/>
697 </INDEXES>
698 </TABLE>
699 <TABLE NAME="stats_user_weekly" COMMENT="To accumulate weekly stats per course/user" PREVIOUS="stats_user_daily" NEXT="stats_user_monthly">
700 <FIELDS>
701 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="courseid"/>
702 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="userid"/>
703 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="courseid" NEXT="roleid"/>
704 <FIELD NAME="roleid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="timeend"/>
705 <FIELD NAME="timeend" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="roleid" NEXT="statsreads"/>
706 <FIELD NAME="statsreads" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timeend" NEXT="statswrites"/>
707 <FIELD NAME="statswrites" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="statsreads" NEXT="stattype"/>
708 <FIELD NAME="stattype" TYPE="char" LENGTH="30" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="statswrites"/>
709 </FIELDS>
710 <KEYS>
711 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for stats_user_weekly"/>
712 </KEYS>
713 <INDEXES>
714 <INDEX NAME="courseid" UNIQUE="false" FIELDS="courseid" NEXT="userid"/>
715 <INDEX NAME="userid" UNIQUE="false" FIELDS="userid" PREVIOUS="courseid" NEXT="roleid"/>
716 <INDEX NAME="roleid" UNIQUE="false" FIELDS="roleid" PREVIOUS="userid" NEXT="timeend"/>
717 <INDEX NAME="timeend" UNIQUE="false" FIELDS="timeend" PREVIOUS="roleid"/>
718 </INDEXES>
719 </TABLE>
720 <TABLE NAME="stats_user_monthly" COMMENT="To accumulate monthly stats per course/user" PREVIOUS="stats_user_weekly" NEXT="post">
721 <FIELDS>
722 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="courseid"/>
723 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="userid"/>
724 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="courseid" NEXT="roleid"/>
725 <FIELD NAME="roleid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="timeend"/>
726 <FIELD NAME="timeend" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="roleid" NEXT="statsreads"/>
727 <FIELD NAME="statsreads" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timeend" NEXT="statswrites"/>
728 <FIELD NAME="statswrites" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="statsreads" NEXT="stattype"/>
729 <FIELD NAME="stattype" TYPE="char" LENGTH="30" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="statswrites"/>
730 </FIELDS>
731 <KEYS>
732 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for stats_user_monthly"/>
733 </KEYS>
734 <INDEXES>
735 <INDEX NAME="courseid" UNIQUE="false" FIELDS="courseid" NEXT="userid"/>
736 <INDEX NAME="userid" UNIQUE="false" FIELDS="userid" PREVIOUS="courseid" NEXT="roleid"/>
737 <INDEX NAME="roleid" UNIQUE="false" FIELDS="roleid" PREVIOUS="userid" NEXT="timeend"/>
738 <INDEX NAME="timeend" UNIQUE="false" FIELDS="timeend" PREVIOUS="roleid"/>
739 </INDEXES>
740 </TABLE>
741 <TABLE NAME="post" COMMENT="Generic post table to hold data blog entries etc in different modules" PREVIOUS="stats_user_monthly" NEXT="tags">
742 <FIELDS>
743 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="true" ENUM="false" NEXT="module"/>
744 <FIELD NAME="module" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="userid"/>
5a1d8354 745 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="module" NEXT="courseid"/>
746 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="groupid"/>
747 <FIELD NAME="groupid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="courseid" NEXT="moduleid"/>
748 <FIELD NAME="moduleid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="groupid" NEXT="coursemoduleid"/>
749 <FIELD NAME="coursemoduleid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="moduleid" NEXT="subject"/>
67d7d694 750 <FIELD NAME="subject" TYPE="char" LENGTH="128" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="coursemoduleid" NEXT="summary"/>
751 <FIELD NAME="summary" TYPE="text" LENGTH="big" NOTNULL="false" SEQUENCE="false" ENUM="false" PREVIOUS="subject" NEXT="content"/>
752 <FIELD NAME="content" TYPE="text" LENGTH="big" NOTNULL="false" SEQUENCE="false" ENUM="false" PREVIOUS="summary" NEXT="uniquehash"/>
753 <FIELD NAME="uniquehash" TYPE="char" LENGTH="128" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="content" NEXT="rating"/>
5a1d8354 754 <FIELD NAME="rating" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="uniquehash" NEXT="format"/>
7d0e5a95 755 <FIELD NAME="format" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="rating" NEXT="attachment"/>
756 <FIELD NAME="attachment" TYPE="char" LENGTH="100" NOTNULL="false" SEQUENCE="false" ENUM="false" COMMENT="attachment" PREVIOUS="format" NEXT="publishstate"/>
757 <FIELD NAME="publishstate" TYPE="char" LENGTH="20" NOTNULL="true" DEFAULT="draft" SEQUENCE="false" ENUM="true" ENUMVALUES="'draft', 'site', 'public'" PREVIOUS="attachment" NEXT="lastmodified"/>
5a1d8354 758 <FIELD NAME="lastmodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="publishstate" NEXT="created"/>
1b63e573 759 <FIELD NAME="created" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="lastmodified" NEXT="usermodified"/>
760 <FIELD NAME="usermodified" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" ENUM="false" PREVIOUS="created"/>
67d7d694 761 </FIELDS>
762 <KEYS>
1b63e573 763 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for post" NEXT="usermodified"/>
764 <KEY NAME="usermodified" TYPE="foreign" FIELDS="usermodified" REFTABLE="user" REFFIELDS="id" COMMENT="Default comment for the key, please edit me" PREVIOUS="primary"/>
67d7d694 765 </KEYS>
766 <INDEXES>
767 <INDEX NAME="id-userid" UNIQUE="true" FIELDS="id, userid" NEXT="lastmodified"/>
768 <INDEX NAME="lastmodified" UNIQUE="false" FIELDS="lastmodified" PREVIOUS="id-userid" NEXT="module"/>
769 <INDEX NAME="module" UNIQUE="false" FIELDS="module" PREVIOUS="lastmodified" NEXT="subject"/>
770 <INDEX NAME="subject" UNIQUE="false" FIELDS="subject" PREVIOUS="module"/>
771 </INDEXES>
772 </TABLE>
773 <TABLE NAME="tags" COMMENT="tags structure for moodle" PREVIOUS="post" NEXT="blog_tag_instance">
774 <FIELDS>
5a1d8354 775 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="type"/>
07076b70 776 <FIELD NAME="type" TYPE="char" LENGTH="20" NOTNULL="true" DEFAULT="official" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="userid"/>
5a1d8354 777 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="type" NEXT="text"/>
07076b70 778 <FIELD NAME="text" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="userid"/>
67d7d694 779 </FIELDS>
780 <KEYS>
781 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for tags"/>
782 </KEYS>
783 <INDEXES>
784 <INDEX NAME="type-userid" UNIQUE="false" FIELDS="type, userid" NEXT="text"/>
785 <INDEX NAME="text" UNIQUE="false" FIELDS="text" PREVIOUS="type-userid"/>
786 </INDEXES>
787 </TABLE>
5a1d8354 788 <TABLE NAME="blog_tag_instance" COMMENT="tag instance for blogs" PREVIOUS="tags" NEXT="role">
67d7d694 789 <FIELDS>
5a1d8354 790 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="entryid"/>
791 <FIELD NAME="entryid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="tagid"/>
792 <FIELD NAME="tagid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="entryid" NEXT="groupid"/>
793 <FIELD NAME="groupid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="tagid" NEXT="courseid"/>
794 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="groupid" NEXT="userid"/>
795 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="courseid" NEXT="timemodified"/>
67d7d694 796 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="userid"/>
797 </FIELDS>
798 <KEYS>
799 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for blog_tag_instance"/>
800 </KEYS>
801 <INDEXES>
802 <INDEX NAME="entryid" UNIQUE="false" FIELDS="entryid" NEXT="tagid"/>
803 <INDEX NAME="tagid" UNIQUE="false" FIELDS="tagid" PREVIOUS="entryid"/>
804 </INDEXES>
805 </TABLE>
5a1d8354 806 <TABLE NAME="role" COMMENT="moodle roles" PREVIOUS="blog_tag_instance" NEXT="context">
807 <FIELDS>
808 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="name"/>
31f26796 809 <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="shortname"/>
810 <FIELD NAME="shortname" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="description"/>
811 <FIELD NAME="description" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="shortname" NEXT="sortorder"/>
5a1d8354 812 <FIELD NAME="sortorder" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="description"/>
813 </FIELDS>
814 <KEYS>
815 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for role"/>
816 </KEYS>
a1bdf659 817 <INDEXES>
ece4945b 818 <INDEX NAME="sortorder" UNIQUE="true" FIELDS="sortorder"/>
a1bdf659 819 </INDEXES>
5a1d8354 820 </TABLE>
0db6adc9 821 <TABLE NAME="context" COMMENT="one of these must be set" PREVIOUS="role" NEXT="context_rel">
5a1d8354 822 <FIELDS>
aad2ba95 823 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="contextlevel"/>
824 <FIELD NAME="contextlevel" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="instanceid"/>
825 <FIELD NAME="instanceid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="contextlevel"/>
5a1d8354 826 </FIELDS>
827 <KEYS>
828 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for context"/>
829 </KEYS>
a1bdf659 830 <INDEXES>
aad2ba95 831 <INDEX NAME="contextlevel-instanceid" UNIQUE="true" FIELDS="contextlevel, instanceid" NEXT="instanceid"/>
832 <INDEX NAME="instanceid" UNIQUE="false" FIELDS="instanceid" PREVIOUS="contextlevel-instanceid"/>
a1bdf659 833 </INDEXES>
834 </TABLE>
0db6adc9 835 <TABLE NAME="context_rel" COMMENT="context relations, c2 is a parent (or higher) of c1" PREVIOUS="context" NEXT="capabilities">
836 <FIELDS>
837 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="true" ENUM="false" NEXT="c1"/>
838 <FIELD NAME="c1" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="false" SEQUENCE="false" ENUM="false" COMMENT="context 1, child context" PREVIOUS="id" NEXT="c2"/>
839 <FIELD NAME="c2" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="false" SEQUENCE="false" ENUM="false" COMMENT="parent (or higher) context" PREVIOUS="c1"/>
840 </FIELDS>
841 <KEYS>
842 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the table, please edit me" NEXT="c1"/>
843 <KEY NAME="c1" TYPE="foreign" FIELDS="c1" REFTABLE="context" REFFIELDS="id" PREVIOUS="primary" NEXT="c2"/>
844 <KEY NAME="c2" TYPE="foreign" FIELDS="c2" REFTABLE="context" REFFIELDS="id" COMMENT="Default comment for the key, please edit me" PREVIOUS="c1" NEXT="c1c2"/>
845 <KEY NAME="c1c2" TYPE="unique" FIELDS="c1, c2" PREVIOUS="c2"/>
846 </KEYS>
847 </TABLE>
848 <TABLE NAME="capabilities" COMMENT="this defines all capabilities" PREVIOUS="context_rel" NEXT="role_allow_assign">
a1bdf659 849 <FIELDS>
850 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="name"/>
851 <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="captype"/>
852 <FIELD NAME="captype" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="contextlevel"/>
853 <FIELD NAME="contextlevel" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="captype" NEXT="component"/>
be4486da 854 <FIELD NAME="component" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="contextlevel" NEXT="riskbitmask"/>
6086e1aa 855 <FIELD NAME="riskbitmask" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="component"/>
a1bdf659 856 </FIELDS>
857 <KEYS>
858 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for capabilities" NEXT="name"/>
859 <KEY NAME="name" TYPE="unique" FIELDS="name" PREVIOUS="primary"/>
860 </KEYS>
5a1d8354 861 </TABLE>
de16da72 862 <TABLE NAME="role_allow_assign" COMMENT="this defines what role can assign what role" PREVIOUS="capabilities" NEXT="role_allow_override">
863 <FIELDS>
864 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="roleid"/>
865 <FIELD NAME="roleid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="allowassign"/>
866 <FIELD NAME="allowassign" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="roleid"/>
867 </FIELDS>
868 <KEYS>
869 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for role_allow_assign" NEXT="roleid"/>
870 <KEY NAME="roleid" TYPE="foreign" FIELDS="roleid" REFTABLE="role" REFFIELDS="id" PREVIOUS="primary" NEXT="allowassign"/>
871 <KEY NAME="allowassign" TYPE="foreign" FIELDS="allowassign" REFTABLE="role" REFFIELDS="id" PREVIOUS="roleid"/>
872 </KEYS>
873 <INDEXES>
874 <INDEX NAME="roleid-allowassign" UNIQUE="true" FIELDS="roleid, allowassign"/>
875 </INDEXES>
876 </TABLE>
877 <TABLE NAME="role_allow_override" COMMENT="this defines what role can override what role" PREVIOUS="role_allow_assign" NEXT="role_assignments">
878 <FIELDS>
879 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="roleid"/>
880 <FIELD NAME="roleid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="allowoverride"/>
881 <FIELD NAME="allowoverride" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="roleid"/>
882 </FIELDS>
883 <KEYS>
884 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for role_allow_override" NEXT="roleid"/>
885 <KEY NAME="roleid" TYPE="foreign" FIELDS="roleid" REFTABLE="role" REFFIELDS="id" PREVIOUS="primary" NEXT="allowoverride"/>
886 <KEY NAME="allowoverride" TYPE="foreign" FIELDS="allowoverride" REFTABLE="role" REFFIELDS="id" PREVIOUS="roleid"/>
887 </KEYS>
888 <INDEXES>
889 <INDEX NAME="roleid-allowoverride" UNIQUE="true" FIELDS="roleid, allowoverride"/>
890 </INDEXES>
891 </TABLE>
892 <TABLE NAME="role_assignments" COMMENT="assigning roles to different context" PREVIOUS="role_allow_override" NEXT="role_capabilities">
5a1d8354 893 <FIELDS>
894 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="roleid"/>
895 <FIELD NAME="roleid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="contextid"/>
896 <FIELD NAME="contextid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="roleid" NEXT="userid"/>
897 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="contextid" NEXT="hidden"/>
898 <FIELD NAME="hidden" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="timestart"/>
899 <FIELD NAME="timestart" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="hidden" NEXT="timeend"/>
900 <FIELD NAME="timeend" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timestart" NEXT="timemodified"/>
901 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timeend" NEXT="modifierid"/>
902 <FIELD NAME="modifierid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timemodified" NEXT="enrol"/>
903 <FIELD NAME="enrol" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="modifierid" NEXT="sortorder"/>
904 <FIELD NAME="sortorder" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="enrol"/>
905 </FIELDS>
906 <KEYS>
a1bdf659 907 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for role_assignments" NEXT="roleid"/>
908 <KEY NAME="roleid" TYPE="foreign" FIELDS="roleid" REFTABLE="role" REFFIELDS="id" PREVIOUS="primary" NEXT="contextid"/>
909 <KEY NAME="contextid" TYPE="foreign" FIELDS="contextid" REFTABLE="context" REFFIELDS="id" PREVIOUS="roleid" NEXT="userid"/>
910 <KEY NAME="userid" TYPE="foreign" FIELDS="userid" REFTABLE="user" REFFIELDS="id" PREVIOUS="contextid"/>
5a1d8354 911 </KEYS>
a1bdf659 912 <INDEXES>
913 <INDEX NAME="contextid-roleid-userid" UNIQUE="true" FIELDS="contextid, roleid, userid" NEXT="sortorder"/>
914 <INDEX NAME="sortorder" UNIQUE="false" FIELDS="sortorder" PREVIOUS="contextid-roleid-userid"/>
915 </INDEXES>
5a1d8354 916 </TABLE>
de16da72 917 <TABLE NAME="role_capabilities" COMMENT="permission has to be signed, overriding a capability for a particular role in a particular context" PREVIOUS="role_assignments" NEXT="role_names">
5a1d8354 918 <FIELDS>
919 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="contextid"/>
920 <FIELD NAME="contextid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="roleid"/>
921 <FIELD NAME="roleid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="contextid" NEXT="capability"/>
922 <FIELD NAME="capability" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="roleid" NEXT="permission"/>
54121a79 923 <FIELD NAME="permission" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="capability" NEXT="timemodified"/>
5a1d8354 924 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="permission" NEXT="modifierid"/>
925 <FIELD NAME="modifierid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timemodified"/>
926 </FIELDS>
927 <KEYS>
a1bdf659 928 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for role_capabilities" NEXT="roleid"/>
929 <KEY NAME="roleid" TYPE="foreign" FIELDS="roleid" REFTABLE="role" REFFIELDS="id" PREVIOUS="primary" NEXT="contextid"/>
930 <KEY NAME="contextid" TYPE="foreign" FIELDS="contextid" REFTABLE="context" REFFIELDS="id" PREVIOUS="roleid" NEXT="modifierid"/>
931 <KEY NAME="modifierid" TYPE="foreign" FIELDS="modifierid" REFTABLE="user" REFFIELDS="id" PREVIOUS="contextid" NEXT="capability"/>
932 <KEY NAME="capability" TYPE="foreign" FIELDS="capability" REFTABLE="capabilities" REFFIELDS="name" PREVIOUS="modifierid"/>
5a1d8354 933 </KEYS>
a1bdf659 934 <INDEXES>
935 <INDEX NAME="roleid-contextid-capability" UNIQUE="true" FIELDS="roleid, contextid, capability"/>
936 </INDEXES>
5a1d8354 937 </TABLE>
b318ecfd 938 <TABLE NAME="role_names" COMMENT="role names in native strings" PREVIOUS="role_capabilities" NEXT="role_sortorder">
5a1d8354 939 <FIELDS>
940 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="roleid"/>
941 <FIELD NAME="roleid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="contextid"/>
942 <FIELD NAME="contextid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="roleid" NEXT="text"/>
943 <FIELD NAME="text" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="contextid"/>
944 </FIELDS>
945 <KEYS>
a1bdf659 946 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for role_names" NEXT="roleid"/>
947 <KEY NAME="roleid" TYPE="foreign" FIELDS="roleid" REFTABLE="role" REFFIELDS="id" COMMENT="Default comment for the key, please edit me" PREVIOUS="primary" NEXT="contextid"/>
948 <KEY NAME="contextid" TYPE="foreign" FIELDS="contextid" REFTABLE="context" REFFIELDS="id" PREVIOUS="roleid"/>
5a1d8354 949 </KEYS>
a1bdf659 950 <INDEXES>
951 <INDEX NAME="roleid-contextid" UNIQUE="true" FIELDS="roleid, contextid"/>
952 </INDEXES>
5a1d8354 953 </TABLE>
b318ecfd 954 <TABLE NAME="role_sortorder" COMMENT="sort order of course managers in a course" PREVIOUS="role_names" NEXT="user_info_field">
955 <FIELDS>
956 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="true" ENUM="false" COMMENT="id of the table, please edit me" NEXT="userid"/>
957 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="roleid"/>
958 <FIELD NAME="roleid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="contextid"/>
959 <FIELD NAME="contextid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" ENUM="false" PREVIOUS="roleid" NEXT="sortoder"/>
960 <FIELD NAME="sortoder" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="false" ENUM="false" PREVIOUS="contextid"/>
961 </FIELDS>
962 <KEYS>
963 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the table, please edit me" NEXT="userid"/>
964 <KEY NAME="userid" TYPE="foreign" FIELDS="userid" REFTABLE="user" REFFIELDS="id" PREVIOUS="primary" NEXT="roleid"/>
965 <KEY NAME="roleid" TYPE="foreign" FIELDS="roleid" REFTABLE="role" REFFIELDS="id" PREVIOUS="userid" NEXT="contextid"/>
966 <KEY NAME="contextid" TYPE="foreign" FIELDS="contextid" REFTABLE="context" REFFIELDS="id" PREVIOUS="roleid"/>
967 </KEYS>
968 <INDEXES>
969 <INDEX NAME="userid-roleid-contextid" UNIQUE="true" FIELDS="userid, roleid, contextid"/>
970 </INDEXES>
971 </TABLE>
972 <TABLE NAME="user_info_field" COMMENT="Customisable user profile fields" PREVIOUS="role_sortorder" NEXT="user_info_category">
adecf1c4 973 <FIELDS>
3261852a 974 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="true" ENUM="false" COMMENT="id of the table, please edit me" NEXT="shortname"/>
975 <FIELD NAME="shortname" TYPE="char" LENGTH="255" NOTNULL="true" DEFAULT="shortname" SEQUENCE="false" ENUM="false" COMMENT="short name for each field" PREVIOUS="id" NEXT="name"/>
976 <FIELD NAME="name" TYPE="text" LENGTH="big" NOTNULL="true" SEQUENCE="false" ENUM="false" COMMENT="field name" PREVIOUS="shortname" NEXT="datatype"/>
74807b43 977 <FIELD NAME="datatype" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" COMMENT="Type of data held in this field" PREVIOUS="name" NEXT="description"/>
978 <FIELD NAME="description" TYPE="text" LENGTH="big" NOTNULL="false" SEQUENCE="false" ENUM="false" COMMENT="Description of field" PREVIOUS="datatype" NEXT="categoryid"/>
979 <FIELD NAME="categoryid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="id from category table" PREVIOUS="description" NEXT="sortorder"/>
adecf1c4 980 <FIELD NAME="sortorder" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="order within the category" PREVIOUS="categoryid" NEXT="required"/>
981 <FIELD NAME="required" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Field required" PREVIOUS="sortorder" NEXT="locked"/>
982 <FIELD NAME="locked" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Field locked" PREVIOUS="required" NEXT="visible"/>
9aaa214e 983 <FIELD NAME="visible" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Visibility: private, public, hidden" PREVIOUS="locked" NEXT="forceunique"/>
984 <FIELD NAME="forceunique" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="should the field contain unique data" PREVIOUS="visible" NEXT="signup"/>
985 <FIELD NAME="signup" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="display field on signup page" PREVIOUS="forceunique" NEXT="defaultdata"/>
986 <FIELD NAME="defaultdata" TYPE="text" LENGTH="big" NOTNULL="false" SEQUENCE="false" ENUM="false" COMMENT="Default value for this field" PREVIOUS="signup" NEXT="param1"/>
74807b43 987 <FIELD NAME="param1" TYPE="text" LENGTH="big" NOTNULL="false" SEQUENCE="false" ENUM="false" COMMENT="General parameter field" PREVIOUS="defaultdata" NEXT="param2"/>
988 <FIELD NAME="param2" TYPE="text" LENGTH="big" NOTNULL="false" SEQUENCE="false" ENUM="false" COMMENT="General parameter field" PREVIOUS="param1" NEXT="param3"/>
989 <FIELD NAME="param3" TYPE="text" LENGTH="big" NOTNULL="false" SEQUENCE="false" ENUM="false" COMMENT="General parameter field" PREVIOUS="param2" NEXT="param4"/>
d5c9d49b 990 <FIELD NAME="param4" TYPE="text" LENGTH="big" NOTNULL="false" SEQUENCE="false" ENUM="false" COMMENT="General parameter field" PREVIOUS="param3" NEXT="param5"/>
74807b43 991 <FIELD NAME="param5" TYPE="text" LENGTH="big" NOTNULL="false" SEQUENCE="false" ENUM="false" COMMENT="General parameter field" PREVIOUS="param4"/>
adecf1c4 992 </FIELDS>
993 <KEYS>
994 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the table, please edit me"/>
995 </KEYS>
996 </TABLE>
997 <TABLE NAME="user_info_category" COMMENT="Customisable fields categories" PREVIOUS="user_info_field" NEXT="user_info_data">
998 <FIELDS>
999 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="true" ENUM="false" COMMENT="id of the table, please edit me" NEXT="name"/>
1000 <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" COMMENT="Category name" PREVIOUS="id" NEXT="sortorder"/>
1001 <FIELD NAME="sortorder" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Display order" PREVIOUS="name"/>
1002 </FIELDS>
1003 <KEYS>
1004 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the table, please edit me"/>
1005 </KEYS>
1006 </TABLE>
9654f633 1007 <TABLE NAME="user_info_data" COMMENT="Data for the customisable user fields" PREVIOUS="user_info_category" NEXT="mnet_enrol_course">
adecf1c4 1008 <FIELDS>
1009 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="true" ENUM="false" COMMENT="id of the table, please edit me" NEXT="userid"/>
1010 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="id from the user table" PREVIOUS="id" NEXT="fieldid"/>
1011 <FIELD NAME="fieldid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="id from the field table" PREVIOUS="userid" NEXT="data"/>
1012 <FIELD NAME="data" TYPE="text" LENGTH="big" NOTNULL="true" SEQUENCE="false" ENUM="false" COMMENT="Field data" PREVIOUS="fieldid"/>
1013 </FIELDS>
1014 <KEYS>
1015 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the table, please edit me"/>
1016 </KEYS>
1017 </TABLE>
9654f633 1018 <TABLE NAME="mnet_enrol_course" COMMENT="Information about courses on remote hosts" PREVIOUS="user_info_data" NEXT="mnet_enrol_assignments">
1019 <FIELDS>
1020 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="true" ENUM="false" COMMENT="Unique remote-course ID" NEXT="hostid"/>
1021 <FIELD NAME="hostid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="remoteid"/>
0db6adc9 1022 <FIELD NAME="remoteid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Unique ID of course on its home server" PREVIOUS="hostid" NEXT="cat_id"/>
9654f633 1023 <FIELD NAME="cat_id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="remoteid" NEXT="cat_name"/>
1024 <FIELD NAME="cat_name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="cat_id" NEXT="cat_description"/>
1025 <FIELD NAME="cat_description" TYPE="text" LENGTH="medium" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="cat_name" NEXT="sortorder"/>
0db6adc9 1026 <FIELD NAME="sortorder" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="cat_description" NEXT="fullname"/>
9654f633 1027 <FIELD NAME="fullname" TYPE="char" LENGTH="254" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="sortorder" NEXT="shortname"/>
1028 <FIELD NAME="shortname" TYPE="char" LENGTH="15" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="fullname" NEXT="idnumber"/>
1029 <FIELD NAME="idnumber" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="shortname" NEXT="summary"/>
1030 <FIELD NAME="summary" TYPE="text" LENGTH="medium" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="idnumber" NEXT="startdate"/>
0db6adc9 1031 <FIELD NAME="startdate" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="summary" NEXT="cost"/>
9654f633 1032 <FIELD NAME="cost" TYPE="char" LENGTH="10" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="startdate" NEXT="currency"/>
1033 <FIELD NAME="currency" TYPE="char" LENGTH="3" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="cost" NEXT="defaultroleid"/>
0db6adc9 1034 <FIELD NAME="defaultroleid" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="currency" NEXT="defaultrolename"/>
9654f633 1035 <FIELD NAME="defaultrolename" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="defaultroleid"/>
1036 </FIELDS>
1037 <KEYS>
1038 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the mnet_course table"/>
1039 </KEYS>
1040 <INDEXES>
0db6adc9 1041 <INDEX NAME="hostid_remoteid" UNIQUE="true" FIELDS="hostid, remoteid"/>
9654f633 1042 </INDEXES>
1043 </TABLE>
1044 <TABLE NAME="mnet_enrol_assignments" COMMENT="Information about enrolments on courses on remote hosts" PREVIOUS="mnet_enrol_course" NEXT="mnet_host">
1045 <FIELDS>
1046 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="true" ENUM="false" COMMENT="Unique enrollment ID" NEXT="userid"/>
0db6adc9 1047 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Unique ID of user on *this* server" PREVIOUS="id" NEXT="hostid"/>
9654f633 1048 <FIELD NAME="hostid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="courseid"/>
0db6adc9 1049 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Unique ID of course on its home server" PREVIOUS="hostid" NEXT="rolename"/>
1050 <FIELD NAME="rolename" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="courseid" NEXT="enroltime"/>
1051 <FIELD NAME="enroltime" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="rolename" NEXT="enroltype"/>
9654f633 1052 <FIELD NAME="enroltype" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="enroltime"/>
1053 </FIELDS>
1054 <KEYS>
1055 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the mnet_enrol_assignments table"/>
1056 </KEYS>
1057 <INDEXES>
0db6adc9 1058 <INDEX NAME="hostid_courseid" UNIQUE="false" FIELDS="hostid, courseid" NEXT="userid"/>
9654f633 1059 <INDEX NAME="userid" UNIQUE="false" FIELDS="userid" PREVIOUS="hostid_courseid"/>
1060 </INDEXES>
1061 </TABLE>
1062 <TABLE NAME="mnet_host" COMMENT="Information about the local and remote hosts for RPC" PREVIOUS="mnet_enrol_assignments" NEXT="mnet_host2service">
1063 <FIELDS>
1064 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="true" ENUM="false" COMMENT="Unique Host ID" NEXT="deleted"/>
1065 <FIELD NAME="deleted" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="wwwroot"/>
1066 <FIELD NAME="wwwroot" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="deleted" NEXT="ip_address"/>
1067 <FIELD NAME="ip_address" TYPE="char" LENGTH="39" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="wwwroot" NEXT="name"/>
1068 <FIELD NAME="name" TYPE="char" LENGTH="80" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="ip_address" NEXT="public_key"/>
1069 <FIELD NAME="public_key" TYPE="text" LENGTH="medium" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="public_key_expires"/>
0db6adc9 1070 <FIELD NAME="public_key_expires" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="public_key" NEXT="transport"/>
1071 <FIELD NAME="transport" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="public_key_expires" NEXT="portno"/>
1072 <FIELD NAME="portno" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="transport" NEXT="last_connect_time"/>
1073 <FIELD NAME="last_connect_time" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="portno" NEXT="last_log_id"/>
1074 <FIELD NAME="last_log_id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="last_connect_time"/>
9654f633 1075 </FIELDS>
1076 <KEYS>
1077 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the mnet_host table"/>
1078 </KEYS>
1079 </TABLE>
1080 <TABLE NAME="mnet_host2service" COMMENT="Information about the services for a given host" PREVIOUS="mnet_host" NEXT="mnet_log">
1081 <FIELDS>
1082 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="true" ENUM="false" NEXT="hostid"/>
0db6adc9 1083 <FIELD NAME="hostid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="serviceid"/>
1084 <FIELD NAME="serviceid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="hostid" NEXT="publish"/>
9654f633 1085 <FIELD NAME="publish" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="serviceid" NEXT="subscribe"/>
1086 <FIELD NAME="subscribe" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="publish"/>
1087 </FIELDS>
1088 <KEYS>
1089 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the mnet_host2service table"/>
1090 </KEYS>
1091 <INDEXES>
0db6adc9 1092 <INDEX NAME="hostid_serviceid" UNIQUE="true" FIELDS="hostid, serviceid"/>
9654f633 1093 </INDEXES>
1094 </TABLE>
1095 <TABLE NAME="mnet_log" COMMENT="Store session data from users migrating to other sites" PREVIOUS="mnet_host2service" NEXT="mnet_rpc">
1096 <FIELDS>
1097 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="true" ENUM="false" NEXT="hostid"/>
0db6adc9 1098 <FIELD NAME="hostid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Unique host ID" PREVIOUS="id" NEXT="remoteid"/>
9654f633 1099 <FIELD NAME="remoteid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="hostid" NEXT="time"/>
1100 <FIELD NAME="time" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="remoteid" NEXT="userid"/>
1101 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="time" NEXT="ip"/>
1102 <FIELD NAME="ip" TYPE="char" LENGTH="15" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="course"/>
1103 <FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="ip" NEXT="coursename"/>
1104 <FIELD NAME="coursename" TYPE="char" LENGTH="40" NOTNULL="true" DEFAULT="" SEQUENCE="false" ENUM="false" PREVIOUS="course" NEXT="module"/>
1105 <FIELD NAME="module" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="coursename" NEXT="cmid"/>
1106 <FIELD NAME="cmid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="module" NEXT="action"/>
1107 <FIELD NAME="action" TYPE="char" LENGTH="40" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="cmid" NEXT="url"/>
1108 <FIELD NAME="url" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="action" NEXT="info"/>
1109 <FIELD NAME="info" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="url"/>
1110 </FIELDS>
1111 <KEYS>
6e783f21 1112 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the mnet_log table"/>
9654f633 1113 </KEYS>
1114 <INDEXES>
1115 <INDEX NAME="hostid_userid_course" UNIQUE="false" FIELDS="hostid, userid, course"/>
1116 </INDEXES>
1117 </TABLE>
1118 <TABLE NAME="mnet_rpc" COMMENT="Functions or methods that we may publish or subscribe to" PREVIOUS="mnet_log" NEXT="mnet_service">
1119 <FIELDS>
1120 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="true" ENUM="false" COMMENT="Unique Function ID" NEXT="function_name"/>
1121 <FIELD NAME="function_name" TYPE="char" LENGTH="40" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="xmlrpc_path"/>
1122 <FIELD NAME="xmlrpc_path" TYPE="char" LENGTH="80" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="function_name" NEXT="parent_type"/>
1123 <FIELD NAME="parent_type" TYPE="char" LENGTH="6" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="xmlrpc_path" NEXT="parent"/>
1124 <FIELD NAME="parent" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="parent_type" NEXT="enabled"/>
0db6adc9 1125 <FIELD NAME="enabled" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="parent" NEXT="help"/>
9654f633 1126 <FIELD NAME="help" TYPE="text" LENGTH="medium" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="enabled" NEXT="profile"/>
1127 <FIELD NAME="profile" TYPE="text" LENGTH="medium" NOTNULL="true" SEQUENCE="false" ENUM="false" COMMENT="Method signature" PREVIOUS="help"/>
1128 </FIELDS>
1129 <KEYS>
1130 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the mnet_rpc table"/>
1131 </KEYS>
1132 <INDEXES>
0db6adc9 1133 <INDEX NAME="enabled_xmlrpcpath" UNIQUE="false" FIELDS="enabled, xmlrpc_path"/>
9654f633 1134 </INDEXES>
1135 </TABLE>
1136 <TABLE NAME="mnet_service" COMMENT="A service is a group of functions" PREVIOUS="mnet_rpc" NEXT="mnet_service2rpc">
1137 <FIELDS>
1138 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="true" ENUM="false" COMMENT="Unique Service ID" NEXT="name"/>
0db6adc9 1139 <FIELD NAME="name" TYPE="char" LENGTH="40" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="description"/>
1140 <FIELD NAME="description" TYPE="char" LENGTH="40" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="apiversion"/>
1141 <FIELD NAME="apiversion" TYPE="char" LENGTH="10" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="description" NEXT="offer"/>
1142 <FIELD NAME="offer" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Do we even offer this service?" PREVIOUS="apiversion"/>
9654f633 1143 </FIELDS>
1144 <KEYS>
1145 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the mnet_service table"/>
1146 </KEYS>
1147 </TABLE>
1148 <TABLE NAME="mnet_service2rpc" COMMENT="Group functions or methods under a service" PREVIOUS="mnet_service" NEXT="mnet_session">
1149 <FIELDS>
1150 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="true" ENUM="false" COMMENT="Required ID field" NEXT="serviceid"/>
0db6adc9 1151 <FIELD NAME="serviceid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Unique service ID" PREVIOUS="id" NEXT="rpcid"/>
1152 <FIELD NAME="rpcid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Unique Function ID" PREVIOUS="serviceid"/>
9654f633 1153 </FIELDS>
1154 <KEYS>
1155 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the mnet_service2rpc table"/>
1156 </KEYS>
1157 <INDEXES>
1158 <INDEX NAME="rpcid_serviceid" UNIQUE="true" FIELDS="rpcid, serviceid"/>
1159 </INDEXES>
1160 </TABLE>
1161 <TABLE NAME="mnet_session" COMMENT="Store session data from users migrating to other sites" PREVIOUS="mnet_service2rpc" NEXT="mnet_sso_access_control">
1162 <FIELDS>
1163 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="true" ENUM="false" COMMENT="Required ID field" NEXT="userid"/>
0db6adc9 1164 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Unique user ID" PREVIOUS="id" NEXT="username"/>
1165 <FIELD NAME="username" TYPE="char" LENGTH="100" NOTNULL="true" DEFAULT="" SEQUENCE="false" ENUM="false" COMMENT="Unique username" PREVIOUS="userid" NEXT="token"/>
1166 <FIELD NAME="token" TYPE="char" LENGTH="40" NOTNULL="true" DEFAULT="" SEQUENCE="false" ENUM="false" COMMENT="Unique SHA1 Token" PREVIOUS="username" NEXT="mnethostid"/>
1167 <FIELD NAME="mnethostid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Unique remote host ID" PREVIOUS="token" NEXT="useragent"/>
1168 <FIELD NAME="useragent" TYPE="char" LENGTH="40" NOTNULL="true" DEFAULT="" SEQUENCE="false" ENUM="false" COMMENT="SHA1 hash of User Agent" PREVIOUS="mnethostid" NEXT="confirm_timeout"/>
1169 <FIELD NAME="confirm_timeout" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="UNIX timestamp for expiry of session" PREVIOUS="useragent" NEXT="session_id"/>
1170 <FIELD NAME="session_id" TYPE="char" LENGTH="40" NOTNULL="true" DEFAULT="" SEQUENCE="false" ENUM="false" COMMENT="The PHP Session ID" PREVIOUS="confirm_timeout" NEXT="expires"/>
1171 <FIELD NAME="expires" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Expire time of session on peer" PREVIOUS="session_id"/>
9654f633 1172 </FIELDS>
1173 <KEYS>
1174 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the mnet_session table"/>
1175 </KEYS>
1176 <INDEXES>
1177 <INDEX NAME="token" UNIQUE="true" FIELDS="token"/>
1178 </INDEXES>
1179 </TABLE>
ec36253d 1180 <TABLE NAME="mnet_sso_access_control" COMMENT="Users by host permitted (or not) to login from a remote provider" PREVIOUS="mnet_session" NEXT="events_handlers">
9654f633 1181 <FIELDS>
1182 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="true" ENUM="false" COMMENT="Required ID field" NEXT="username"/>
0db6adc9 1183 <FIELD NAME="username" TYPE="char" LENGTH="100" NOTNULL="true" DEFAULT="" SEQUENCE="false" ENUM="false" COMMENT="Username" PREVIOUS="id" NEXT="mnet_host_id"/>
cdf22329 1184 <FIELD NAME="mnet_host_id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="id of mnet host" PREVIOUS="username" NEXT="accessctrl"/>
1185 <FIELD NAME="accessctrl" TYPE="char" LENGTH="20" NOTNULL="true" DEFAULT="allow" SEQUENCE="false" ENUM="false" COMMENT="Whether or not this user/host can login" PREVIOUS="mnet_host_id"/>
9654f633 1186 </FIELDS>
1187 <KEYS>
1188 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the mnet_sso_access_control table"/>
1189 </KEYS>
1190 <INDEXES>
1191 <INDEX NAME="mnethostid_username" UNIQUE="true" FIELDS="mnet_host_id, username"/>
1192 </INDEXES>
1193 </TABLE>
b67ec72f 1194 <TABLE NAME="events_handlers" COMMENT="This table is for storing which components requests what type of event, and the location of the responsible handlers. For example, the assignment registers 'grade_updated' event with a function assignment_grade_handler() that should be called event time an 'grade_updated' event is triggered by grade_update() function." PREVIOUS="mnet_sso_access_control" NEXT="events_queue">
ec36253d 1195 <FIELDS>
1196 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="true" ENUM="false" COMMENT="id of the table, please edit me" NEXT="eventname"/>
de420c11 1197 <FIELD NAME="eventname" TYPE="char" LENGTH="166" NOTNULL="true" SEQUENCE="false" ENUM="false" COMMENT="name of the event, e.g. 'grade_updated'" PREVIOUS="id" NEXT="handlermodule"/>
5cb564aa 1198 <FIELD NAME="handlermodule" TYPE="char" LENGTH="166" NOTNULL="true" SEQUENCE="false" ENUM="false" COMMENT="e.g. moodle, mod/forum, block/rss_client" PREVIOUS="eventname" NEXT="handlerfile"/>
ec36253d 1199 <FIELD NAME="handlerfile" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" COMMENT="path to the file of the function, eg /grade/export/lib.php" PREVIOUS="handlermodule" NEXT="handlerfunction"/>
896f1e03 1200 <FIELD NAME="handlerfunction" TYPE="text" LENGTH="medium" NOTNULL="false" SEQUENCE="false" ENUM="false" COMMENT="serialized string or array describing function, suitable to be passed to call_user_func()" PREVIOUS="handlerfile" NEXT="schedule"/>
1201 <FIELD NAME="schedule" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" ENUM="false" COMMENT="'cron' or 'instant'." PREVIOUS="handlerfunction" NEXT="status"/>
1202 <FIELD NAME="status" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="number of failed attempts to process this handler" PREVIOUS="schedule"/>
ec36253d 1203 </FIELDS>
1204 <KEYS>
5cb564aa 1205 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the table, please edit me"/>
ec36253d 1206 </KEYS>
1207 <INDEXES>
5cb564aa 1208 <INDEX NAME="eventname-handlermodule" UNIQUE="true" FIELDS="eventname, handlermodule"/>
ec36253d 1209 </INDEXES>
1210 </TABLE>
d46306de 1211 <TABLE NAME="events_queue" COMMENT="This table is for storing queued events. It stores only one copy of the eventdata here, and entries from this table are being references by the event_queue_handlers table." PREVIOUS="events_handlers" NEXT="events_queue_handlers">
ec36253d 1212 <FIELDS>
1213 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="true" ENUM="false" COMMENT="id of the table, please edit me" NEXT="eventdata"/>
d46306de 1214 <FIELD NAME="eventdata" TYPE="text" LENGTH="big" NOTNULL="true" SEQUENCE="false" ENUM="false" COMMENT="serialized version of the data object passed to the event handler." PREVIOUS="id" NEXT="stackdump"/>
1215 <FIELD NAME="stackdump" TYPE="text" LENGTH="medium" NOTNULL="false" SEQUENCE="false" ENUM="false" COMMENT="serialized debug_backtrace showing where the event was fired from" PREVIOUS="eventdata" NEXT="userid"/>
ec36253d 1216 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" ENUM="false" COMMENT="$USER-&amp;gt;id when the event was fired" PREVIOUS="stackdump" NEXT="timecreated"/>
1217 <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" ENUM="false" COMMENT="time stamp of the first time this was added" PREVIOUS="userid"/>
1218 </FIELDS>
1219 <KEYS>
1220 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the table, please edit me" NEXT="userid"/>
1221 <KEY NAME="userid" TYPE="foreign" FIELDS="userid" REFTABLE="user" REFFIELDS="id" PREVIOUS="primary"/>
1222 </KEYS>
1223 </TABLE>
5cb564aa 1224 <TABLE NAME="events_queue_handlers" COMMENT="This is the list of queued handlers for processing. The event object is retrieved from the events_queue table. When no further reference is made to the event_queues table, the corresponding entry in the events_queue table should be deleted. Entry should get deleted after a successful event processing by the specified handler." PREVIOUS="events_queue" NEXT="grade_items">
ec36253d 1225 <FIELDS>
1226 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="true" ENUM="false" COMMENT="id of the table, please edit me" NEXT="queuedeventid"/>
1227 <FIELD NAME="queuedeventid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" ENUM="false" COMMENT="foreign key id corresponding to the id of the event_queues table" PREVIOUS="id" NEXT="handlerid"/>
1228 <FIELD NAME="handlerid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" ENUM="false" COMMENT="foreign key id corresponding to the id of the event_handlers table" PREVIOUS="queuedeventid" NEXT="status"/>
1229 <FIELD NAME="status" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="false" SEQUENCE="false" ENUM="false" COMMENT="number of failed attempts to process this handler" PREVIOUS="handlerid" NEXT="errormessage"/>
1230 <FIELD NAME="errormessage" TYPE="text" LENGTH="medium" NOTNULL="false" SEQUENCE="false" ENUM="false" COMMENT="if an error happened last time we tried to process this event, record it here." PREVIOUS="status" NEXT="timemodified"/>
1231 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" ENUM="false" COMMENT="time stamp of the last attempt to run this from the queue" PREVIOUS="errormessage"/>
1232 </FIELDS>
1233 <KEYS>
1234 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the table, please edit me" NEXT="queuedeventid"/>
1235 <KEY NAME="queuedeventid" TYPE="foreign" FIELDS="queuedeventid" REFTABLE="events_queue" REFFIELDS="id" PREVIOUS="primary" NEXT="handlerid"/>
1236 <KEY NAME="handlerid" TYPE="foreign" FIELDS="handlerid" REFTABLE="events_handlers" REFFIELDS="id" PREVIOUS="queuedeventid"/>
1237 </KEYS>
1238 </TABLE>
5cb564aa 1239 <TABLE NAME="grade_items" COMMENT="This table keeps information about gradeable items (ie columns). If an activity (eg an assignment or quiz) has multiple grade_items associated with it (eg several outcomes or numerical grades), then there will be a corresponding multiple number of rows in this table." PREVIOUS="events_queue_handlers" NEXT="grade_categories">
1240 <FIELDS>
1241 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="true" ENUM="false" COMMENT="id of the table, please edit me" NEXT="courseid"/>
1242 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" ENUM="false" COMMENT="The course this item is part of" PREVIOUS="id" NEXT="categoryid"/>
1243 <FIELD NAME="categoryid" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" ENUM="false" COMMENT="(optional) the category group this item belongs to" PREVIOUS="courseid" NEXT="itemname"/>
f92dcad8 1244 <FIELD NAME="itemname" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" ENUM="false" COMMENT="The name of this item (pushed in by the module)" PREVIOUS="categoryid" NEXT="itemtype"/>
5cb564aa 1245 <FIELD NAME="itemtype" TYPE="char" LENGTH="30" NOTNULL="true" SEQUENCE="false" ENUM="false" COMMENT="'mod', 'blocks', 'import', 'calculated' etc" PREVIOUS="itemname" NEXT="itemmodule"/>
f92dcad8 1246 <FIELD NAME="itemmodule" TYPE="char" LENGTH="30" NOTNULL="false" SEQUENCE="false" ENUM="false" COMMENT="'forum', 'quiz', 'csv', etc" PREVIOUS="itemtype" NEXT="iteminstance"/>
5cb564aa 1247 <FIELD NAME="iteminstance" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" ENUM="false" COMMENT="id of the item module" PREVIOUS="itemmodule" NEXT="itemnumber"/>
1248 <FIELD NAME="itemnumber" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" ENUM="false" COMMENT="Can be used to distinguish multiple grades for an activity" PREVIOUS="iteminstance" NEXT="iteminfo"/>
f92dcad8 1249 <FIELD NAME="iteminfo" TYPE="text" LENGTH="medium" NOTNULL="false" SEQUENCE="false" ENUM="false" COMMENT="Info and notes about this item XXX" PREVIOUS="itemnumber" NEXT="idnumber"/>
61c33818 1250 <FIELD NAME="idnumber" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" ENUM="false" COMMENT="Arbitrary idnumber provided by the module responsible" PREVIOUS="iteminfo" NEXT="calculation"/>
1251 <FIELD NAME="calculation" TYPE="text" LENGTH="medium" NOTNULL="false" SEQUENCE="false" ENUM="false" COMMENT="Formula describing how to derive this grade from other items, referring to them using giXXX where XXX is grade item id ... eg something like: =sin(square([#gi20#])) + [#gi30#]" PREVIOUS="idnumber" NEXT="gradetype"/>
1252 <FIELD NAME="gradetype" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="false" DEFAULT="1" SEQUENCE="false" ENUM="false" COMMENT="0 = none, 1 = value, 2 = scale, 3 = text" PREVIOUS="calculation" NEXT="grademax"/>
5cb564aa 1253 <FIELD NAME="grademax" TYPE="number" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="100" SEQUENCE="false" ENUM="false" DECIMALS="5" COMMENT="What is the maximum allowable grade?" PREVIOUS="gradetype" NEXT="grademin"/>
1254 <FIELD NAME="grademin" TYPE="number" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" DECIMALS="5" COMMENT="What is the minimum allowable grade?" PREVIOUS="grademax" NEXT="scaleid"/>
1255 <FIELD NAME="scaleid" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" ENUM="false" COMMENT="If this grade is based on a scale, which one is it?" PREVIOUS="grademin" NEXT="outcomeid"/>
1256 <FIELD NAME="outcomeid" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="false" SEQUENCE="false" ENUM="false" COMMENT="If this grade is related to an outcome, which one is it?" PREVIOUS="scaleid" NEXT="gradepass"/>
1257 <FIELD NAME="gradepass" TYPE="number" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" DECIMALS="5" COMMENT="What grade is needed to pass? grademin &amp;lt; gradepass &amp;lt;= grademax" PREVIOUS="outcomeid" NEXT="multfactor"/>
1258 <FIELD NAME="multfactor" TYPE="number" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="1.0" SEQUENCE="false" ENUM="false" DECIMALS="5" COMMENT="Multiply all grades by this" PREVIOUS="gradepass" NEXT="plusfactor"/>
1259 <FIELD NAME="plusfactor" TYPE="number" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" DECIMALS="5" COMMENT="Add this to all grades" PREVIOUS="multfactor" NEXT="sortorder"/>
1260 <FIELD NAME="sortorder" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Sorting order of the columns" PREVIOUS="plusfactor" NEXT="hidden"/>
1261 <FIELD NAME="hidden" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="1 is hidden, &amp;gt; 1 is a date to hide until (prevents viewing)" PREVIOUS="sortorder" NEXT="locked"/>
ac9b0805 1262 <FIELD NAME="locked" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="1 is locked, &amp;gt; 1 is a date to lock until (prevents update)" PREVIOUS="hidden" NEXT="locktime"/>
1263 <FIELD NAME="locktime" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="lock all final grades after this date" PREVIOUS="locked" NEXT="deleted"/>
1264 <FIELD NAME="deleted" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="1 means the associated module instance has been deleted" PREVIOUS="locktime" NEXT="needsupdate"/>
ec4560cc 1265 <FIELD NAME="needsupdate" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="If this flag is set, then the whole column will be recalculated" PREVIOUS="deleted" NEXT="timecreated"/>
5cb564aa 1266 <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" ENUM="false" COMMENT="The first time this grade_item was created" PREVIOUS="needsupdate" NEXT="timemodified"/>
1267 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" ENUM="false" COMMENT="The last time this grade_item was modified" PREVIOUS="timecreated"/>
1268 </FIELDS>
1269 <KEYS>
1270 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the table, please edit me" NEXT="courseid"/>
1271 <KEY NAME="courseid" TYPE="foreign" FIELDS="courseid" REFTABLE="course" REFFIELDS="id" PREVIOUS="primary" NEXT="categoryid"/>
1272 <KEY NAME="categoryid" TYPE="foreign" FIELDS="categoryid" REFTABLE="grade_categories" REFFIELDS="id" PREVIOUS="courseid" NEXT="scaleid"/>
1273 <KEY NAME="scaleid" TYPE="foreign" FIELDS="scaleid" REFTABLE="scale" REFFIELDS="id" PREVIOUS="categoryid" NEXT="outcomeid"/>
1274 <KEY NAME="outcomeid" TYPE="foreign" FIELDS="outcomeid" REFTABLE="grade_outcomes" REFFIELDS="id" PREVIOUS="scaleid"/>
1275 </KEYS>
1276 </TABLE>
61c33818 1277 <TABLE NAME="grade_categories" COMMENT="This table keeps information about categories, used for grouping items." PREVIOUS="grade_items" NEXT="grade_grades">
5cb564aa 1278 <FIELDS>
1279 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="true" ENUM="false" COMMENT="id of the table, please edit me" NEXT="courseid"/>
9d2cddf1 1280 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" ENUM="false" COMMENT="The course this grade category is part of" PREVIOUS="id" NEXT="parent"/>
cb63031c 1281 <FIELD NAME="parent" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" ENUM="false" COMMENT="Categories can be hierarchical" PREVIOUS="courseid" NEXT="depth"/>
1282 <FIELD NAME="depth" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="How many parents does this category have?" PREVIOUS="parent" NEXT="path"/>
82bf496e 1283 <FIELD NAME="path" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" ENUM="false" COMMENT="shows the path as /1/2/3 (like course_categories)" PREVIOUS="depth" NEXT="fullname"/>
9d2cddf1 1284 <FIELD NAME="fullname" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" COMMENT="The name of this grade category" PREVIOUS="path" NEXT="aggregation"/>
5cb564aa 1285 <FIELD NAME="aggregation" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="A constant pointing to one of the predefined aggregation strategies (none, mean,median,sum, etc)" PREVIOUS="fullname" NEXT="keephigh"/>
1286 <FIELD NAME="keephigh" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Keep only the X highest items" PREVIOUS="aggregation" NEXT="droplow"/>
ec4560cc 1287 <FIELD NAME="droplow" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Drop the X lowest items" PREVIOUS="keephigh" NEXT="timecreated"/>
1288 <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" ENUM="false" PREVIOUS="droplow" NEXT="timemodified"/>
db07a42e 1289 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" ENUM="false" PREVIOUS="timecreated"/>
5cb564aa 1290 </FIELDS>
1291 <KEYS>
1292 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the table, please edit me" NEXT="courseid"/>
9d2cddf1 1293 <KEY NAME="courseid" TYPE="foreign" FIELDS="courseid" REFTABLE="course" REFFIELDS="id" PREVIOUS="primary" NEXT="parent"/>
1294 <KEY NAME="parent" TYPE="foreign" FIELDS="parent" REFTABLE="grade_categories" REFFIELDS="id" PREVIOUS="courseid"/>
5cb564aa 1295 </KEYS>
1296 </TABLE>
61c33818 1297 <TABLE NAME="grade_grades" COMMENT="grade_grades This table keeps individual grades for each user and each item, exactly as imported or submitted by modules. The rawgrademax/min and rawscaleid are stored here to record the values at the time the grade was stored, because teachers might change this for an activity! All the results are normalised/resampled for the final grade value." PREVIOUS="grade_categories" NEXT="grade_grades_text">
5cb564aa 1298 <FIELDS>
1299 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="true" ENUM="false" COMMENT="id of the table, please edit me" NEXT="itemid"/>
1300 <FIELD NAME="itemid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" ENUM="false" COMMENT="The item this grade belongs to" PREVIOUS="id" NEXT="userid"/>
ac9b0805 1301 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" ENUM="false" COMMENT="The user who this grade is for" PREVIOUS="itemid" NEXT="rawgrade"/>
1302 <FIELD NAME="rawgrade" TYPE="number" LENGTH="10" NOTNULL="false" UNSIGNED="false" SEQUENCE="false" ENUM="false" DECIMALS="5" COMMENT="If the grade is a float value (or has been converted to one)" PREVIOUS="userid" NEXT="rawgrademax"/>
1303 <FIELD NAME="rawgrademax" TYPE="number" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="100" SEQUENCE="false" ENUM="false" DECIMALS="5" COMMENT="The maximum allowable grade when this was created" PREVIOUS="rawgrade" NEXT="rawgrademin"/>
1304 <FIELD NAME="rawgrademin" TYPE="number" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" DECIMALS="5" COMMENT="The minimum allowable grade when this was created" PREVIOUS="rawgrademax" NEXT="rawscaleid"/>
1305 <FIELD NAME="rawscaleid" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" ENUM="false" COMMENT="If this grade is based on a scale, which one was it?" PREVIOUS="rawgrademin" NEXT="usermodified"/>
1306 <FIELD NAME="usermodified" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" ENUM="false" COMMENT="the userid of the person who last modified this grade" PREVIOUS="rawscaleid" NEXT="finalgrade"/>
1307 <FIELD NAME="finalgrade" TYPE="number" LENGTH="10" NOTNULL="false" UNSIGNED="false" SEQUENCE="false" ENUM="false" DECIMALS="5" COMMENT="The final grade (cached) after all calculations are made" PREVIOUS="usermodified" NEXT="hidden"/>
1308 <FIELD NAME="hidden" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="show 0, hide 1 or hide until date" PREVIOUS="finalgrade" NEXT="locked"/>
1309 <FIELD NAME="locked" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="not locked 0, locked from date" PREVIOUS="hidden" NEXT="locktime"/>
1310 <FIELD NAME="locktime" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="automatic locking of final grade, 0 means none, date otherwise" PREVIOUS="locked" NEXT="exported"/>
1311 <FIELD NAME="exported" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="date of last grade export, 0 if none" PREVIOUS="locktime" NEXT="timecreated"/>
1312 <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" ENUM="false" COMMENT="the time this grade was first created" PREVIOUS="exported" NEXT="timemodified"/>
1313 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" ENUM="false" COMMENT="the time this grade was last modified" PREVIOUS="timecreated"/>
5cb564aa 1314 </FIELDS>
1315 <KEYS>
1316 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the table, please edit me" NEXT="itemid"/>
1317 <KEY NAME="itemid" TYPE="foreign" FIELDS="itemid" REFTABLE="grade_items" REFFIELDS="id" PREVIOUS="primary" NEXT="userid"/>
ac9b0805 1318 <KEY NAME="userid" TYPE="foreign" FIELDS="userid" REFTABLE="user" REFFIELDS="id" PREVIOUS="itemid" NEXT="rawscaleid"/>
1319 <KEY NAME="rawscaleid" TYPE="foreign" FIELDS="rawscaleid" REFTABLE="scale" REFFIELDS="id" PREVIOUS="userid" NEXT="usermodified"/>
1320 <KEY NAME="usermodified" TYPE="foreign" FIELDS="usermodified" REFTABLE="user" REFFIELDS="id" PREVIOUS="rawscaleid"/>
5cb564aa 1321 </KEYS>
1322 </TABLE>
ac9b0805 1323 <TABLE NAME="grade_grades_text" COMMENT="This table keeps additional textual information about each individual grade, whether it be automatically generated from the module or entered manually by the teacher. It's here separate from the all-numeric grade_grades for database efficiency reasons." PREVIOUS="grade_grades" NEXT="grade_outcomes">
5cb564aa 1324 <FIELDS>
82bf496e 1325 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="true" ENUM="false" COMMENT="id of the table, please edit me" NEXT="gradeid"/>
1326 <FIELD NAME="gradeid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="information"/>
1327 <FIELD NAME="information" TYPE="text" LENGTH="medium" NOTNULL="false" SEQUENCE="false" ENUM="false" COMMENT="Further information like forum rating distribution 4/5/7/0/1" PREVIOUS="gradeid" NEXT="informationformat"/>
896f1e03 1328 <FIELD NAME="informationformat" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Text format for information" PREVIOUS="information" NEXT="feedback"/>
6ec4869e 1329 <FIELD NAME="feedback" TYPE="text" LENGTH="medium" NOTNULL="false" SEQUENCE="false" ENUM="false" COMMENT="Manual feedback from the teacher. Could be a code like 'mi'." PREVIOUS="informationformat" NEXT="feedbackformat"/>
1330 <FIELD NAME="feedbackformat" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Text format for feedback" PREVIOUS="feedback" NEXT="timecreated"/>
1331 <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" ENUM="false" COMMENT="the time these entry was first created" PREVIOUS="feedbackformat" NEXT="timemodified"/>
5cb564aa 1332 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="false" SEQUENCE="false" ENUM="false" COMMENT="the time this entry was last updated" PREVIOUS="timecreated" NEXT="usermodified"/>
1333 <FIELD NAME="usermodified" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="false" SEQUENCE="false" ENUM="false" COMMENT="the userid of the person who last modified this entry" PREVIOUS="timemodified"/>
1334 </FIELDS>
1335 <KEYS>
f13002d5 1336 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the table, please edit me" NEXT="gradeid"/>
1337 <KEY NAME="gradeid" TYPE="foreign" FIELDS="gradeid" REFTABLE="grade_grades" REFFIELDS="id" PREVIOUS="primary" NEXT="usermodified"/>
1338 <KEY NAME="usermodified" TYPE="foreign" FIELDS="usermodified" REFTABLE="user" REFFIELDS="id" PREVIOUS="gradeid"/>
5cb564aa 1339 </KEYS>
1340 </TABLE>
1341 <TABLE NAME="grade_outcomes" COMMENT="This table describes the outcomes used in the system. An outcome is a statement tied to a rubric scale from low to high, such as “Not met, Borderline, Met” (stored as 0,1 or 2)" PREVIOUS="grade_grades_text" NEXT="grade_history">
1342 <FIELDS>
1343 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="true" ENUM="false" COMMENT="id of the table, please edit me" NEXT="courseid"/>
1344 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" ENUM="false" COMMENT="Mostly these are defined site wide ie NULL" PREVIOUS="id" NEXT="shortname"/>
1345 <FIELD NAME="shortname" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" COMMENT="The short name or code for this outcome statement" PREVIOUS="courseid" NEXT="fullname"/>
1346 <FIELD NAME="fullname" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" COMMENT="The full description of the outcome (usually 1 sentence)" PREVIOUS="shortname" NEXT="scaleid"/>
1347 <FIELD NAME="scaleid" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" ENUM="false" COMMENT="The recommended scale for this outcome." PREVIOUS="fullname" NEXT="timecreated"/>
1348 <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" ENUM="false" COMMENT="the time this outcome was first created" PREVIOUS="scaleid" NEXT="timemodified"/>
1349 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" ENUM="false" COMMENT="the time this outcome was last updated" PREVIOUS="timecreated" NEXT="usermodified"/>
1350 <FIELD NAME="usermodified" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" ENUM="false" COMMENT="the userid of the person who last modified this outcome" PREVIOUS="timemodified"/>
1351 </FIELDS>
1352 <KEYS>
1353 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the table, please edit me" NEXT="courseid"/>
1354 <KEY NAME="courseid" TYPE="foreign" FIELDS="courseid" REFTABLE="course" REFFIELDS="id" PREVIOUS="primary" NEXT="scaleid"/>
1355 <KEY NAME="scaleid" TYPE="foreign" FIELDS="scaleid" REFTABLE="scale" REFFIELDS="id" PREVIOUS="courseid" NEXT="usermodified"/>
1356 <KEY NAME="usermodified" TYPE="foreign" FIELDS="usermodified" REFTABLE="user" REFFIELDS="id" PREVIOUS="scaleid"/>
1357 </KEYS>
1358 </TABLE>
4d40aa14 1359 <TABLE NAME="grade_history" COMMENT="This table keeps track of grade changes. Using this it should be possible to reconstruct the grades at any point in time in the past, or to audit grade changes over time. It should be quicker to use this table for that, rather than storing this information in the main Moodle log. Note we use itemid and userid as a key rather than grade_grade id, just in case one of the things we want to log here is the deletion of a grade entirely." PREVIOUS="grade_outcomes" NEXT="grade_import_values">
5cb564aa 1360 <FIELDS>
1361 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="true" ENUM="false" COMMENT="id of the table, please edit me" NEXT="itemid"/>
1362 <FIELD NAME="itemid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" ENUM="false" COMMENT="The grade_item the grade is from" PREVIOUS="id" NEXT="userid"/>
1363 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="false" ENUM="false" COMMENT="The user that the grade belongs to" PREVIOUS="itemid" NEXT="oldgrade"/>
1364 <FIELD NAME="oldgrade" TYPE="number" LENGTH="10" NOTNULL="false" UNSIGNED="false" SEQUENCE="false" ENUM="false" DECIMALS="5" COMMENT="The original grade before the change" PREVIOUS="userid" NEXT="newgrade"/>
1365 <FIELD NAME="newgrade" TYPE="number" LENGTH="10" NOTNULL="false" UNSIGNED="false" SEQUENCE="false" ENUM="false" DECIMALS="5" COMMENT="The new grade after the change" PREVIOUS="oldgrade" NEXT="note"/>
1366 <FIELD NAME="note" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" ENUM="false" COMMENT="An optional note about why this change was made" PREVIOUS="newgrade" NEXT="howmodified"/>
1367 <FIELD NAME="howmodified" TYPE="char" LENGTH="255" NOTNULL="true" DEFAULT="manual" SEQUENCE="false" ENUM="false" COMMENT="What caused the modification? manual/module/import/..." PREVIOUS="note" NEXT="usermodified"/>
1368 <FIELD NAME="usermodified" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" ENUM="false" COMMENT="The user id of the person who made the change" PREVIOUS="howmodified" NEXT="timemodified"/>
1369 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" ENUM="false" COMMENT="The exact time this change was made" PREVIOUS="usermodified"/>
1370 </FIELDS>
1371 <KEYS>
1372 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the table, please edit me" NEXT="itemid"/>
1373 <KEY NAME="itemid" TYPE="foreign" FIELDS="itemid" REFTABLE="grade_items" REFFIELDS="id" PREVIOUS="primary" NEXT="userid"/>
1374 <KEY NAME="userid" TYPE="foreign" FIELDS="userid" REFTABLE="user" REFFIELDS="id" PREVIOUS="itemid" NEXT="usermodified"/>
1375 <KEY NAME="usermodified" TYPE="foreign" FIELDS="usermodified" REFTABLE="user" REFFIELDS="id" PREVIOUS="userid"/>
1376 </KEYS>
1377 </TABLE>
4d40aa14 1378 <TABLE NAME="grade_import_values" COMMENT="Temporary table for importing grades" PREVIOUS="grade_history" NEXT="grade_import_newitem">
1379 <FIELDS>
1380 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="true" ENUM="false" COMMENT="id of the table, please edit me" NEXT="itemid"/>
1381 <FIELD NAME="itemid" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" ENUM="false" COMMENT="if set, this points to existing grade_items id" PREVIOUS="id" NEXT="newgradeitem"/>
1382 <FIELD NAME="newgradeitem" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" ENUM="false" COMMENT="if set, points to the id of grade_import_newitem" PREVIOUS="itemid" NEXT="userid"/>
ac9b0805 1383 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" ENUM="false" PREVIOUS="newgradeitem" NEXT="rawgrade"/>
1384 <FIELD NAME="rawgrade" TYPE="number" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0.0" SEQUENCE="false" ENUM="false" DECIMALS="5" COMMENT="raw grade value" PREVIOUS="userid" NEXT="import_code"/>
1385 <FIELD NAME="import_code" TYPE="int" LENGTH="12" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" ENUM="false" COMMENT="similar to backup_code, a unique batch code for identifying one batch of imports" PREVIOUS="rawgrade"/>
4d40aa14 1386 </FIELDS>
1387 <KEYS>
1388 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the table, please edit me" NEXT="itemid"/>
1389 <KEY NAME="itemid" TYPE="foreign" FIELDS="itemid" REFTABLE="grade_items" REFFIELDS="id" PREVIOUS="primary" NEXT="newgradeitem"/>
1390 <KEY NAME="newgradeitem" TYPE="foreign" FIELDS="newgradeitem" REFTABLE="grade_import_newitem" REFFIELDS="id" PREVIOUS="itemid"/>
1391 </KEYS>
1392 </TABLE>
1393 <TABLE NAME="grade_import_newitem" COMMENT="temporary table for storing new grade_item names from grade import" PREVIOUS="grade_import_values">
1394 <FIELDS>
1395 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="true" ENUM="false" COMMENT="id of the table, please edit me" NEXT="itemname"/>
43a8e6aa 1396 <FIELD NAME="itemname" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" COMMENT="new grade item name" PREVIOUS="id" NEXT="import_code"/>
1397 <FIELD NAME="import_code" TYPE="int" LENGTH="12" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" ENUM="false" COMMENT="import batch code for identification" PREVIOUS="itemname"/>
4d40aa14 1398 </FIELDS>
1399 <KEYS>
1400 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the table, please edit me"/>
1401 </KEYS>
1402 </TABLE>
67d7d694 1403 </TABLES>
1404 <STATEMENTS>
1405 <STATEMENT NAME="insert log_display" TYPE="insert" TABLE="log_display" COMMENT="Initial insert of records on table log_display">
1406 <SENTENCES>
1407 <SENTENCE TEXT="(module, action, mtable, field) VALUES ('user', 'view', 'user', 'CONCAT(firstname,&quot; &quot;,lastname)')" />
1408 <SENTENCE TEXT="(module, action, mtable, field) VALUES ('course', 'user report', 'user', 'CONCAT(firstname,&quot; &quot;,lastname)')" />
1409 <SENTENCE TEXT="(module, action, mtable, field) VALUES ('course', 'view', 'course', 'fullname')" />
1410 <SENTENCE TEXT="(module, action, mtable, field) VALUES ('course', 'update', 'course', 'fullname')" />
1411 <SENTENCE TEXT="(module, action, mtable, field) VALUES ('course', 'enrol', 'course', 'fullname')" />
1412 <SENTENCE TEXT="(module, action, mtable, field) VALUES ('course', 'report log', 'course', 'fullname')" />
1413 <SENTENCE TEXT="(module, action, mtable, field) VALUES ('course', 'report live', 'course', 'fullname')" />
1414 <SENTENCE TEXT="(module, action, mtable, field) VALUES ('course', 'report outline', 'course', 'fullname')" />
1415 <SENTENCE TEXT="(module, action, mtable, field) VALUES ('course', 'report participation', 'course', 'fullname')" />
1416 <SENTENCE TEXT="(module, action, mtable, field) VALUES ('course', 'report stats', 'course', 'fullname')" />
1417 <SENTENCE TEXT="(module, action, mtable, field) VALUES ('message', 'write', 'user', 'CONCAT(firstname,&quot; &quot;,lastname)')" />
1418 <SENTENCE TEXT="(module, action, mtable, field) VALUES ('message', 'read', 'user', 'CONCAT(firstname,&quot; &quot;,lastname)')" />
1419 <SENTENCE TEXT="(module, action, mtable, field) VALUES ('message', 'add contact', 'user', 'CONCAT(firstname,&quot; &quot;,lastname)')" />
1420 <SENTENCE TEXT="(module, action, mtable, field) VALUES ('message', 'remove contact', 'user', 'CONCAT(firstname,&quot; &quot;,lastname)')" />
1421 <SENTENCE TEXT="(module, action, mtable, field) VALUES ('message', 'block contact', 'user', 'CONCAT(firstname,&quot; &quot;,lastname)')" />
1422 <SENTENCE TEXT="(module, action, mtable, field) VALUES ('message', 'unblock contact', 'user', 'CONCAT(firstname,&quot; &quot;,lastname)')" />
1423 </SENTENCES>
1424 </STATEMENT>
1425 </STATEMENTS>
ec0009c3 1426</XMLDB>