Bug #6277 - Missed function renaming in question/format/multianswer. Merged from...
[moodle.git] / lib / db / install.xml
CommitLineData
67d7d694 1<?xml version="1.0" encoding="UTF-8" ?>
54121a79 2<XMLDB PATH="lib/db" VERSION="20060816" COMMENT="XMLDB file for core Moodle tables">
67d7d694 3 <TABLES>
4 <TABLE NAME="config" COMMENT="Moodle configuration variables" NEXT="config_plugins">
5 <FIELDS>
6 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="name"/>
7 <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="value"/>
8 <FIELD NAME="value" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="name"/>
9 </FIELDS>
10 <KEYS>
11 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for config" NEXT="name"/>
12 <KEY NAME="name" TYPE="unique" FIELDS="name" PREVIOUS="primary"/>
13 </KEYS>
14 </TABLE>
15 <TABLE NAME="config_plugins" COMMENT="Moodle modules and plugins configuration variables" PREVIOUS="config" NEXT="course">
16 <FIELDS>
17 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="plugin"/>
18 <FIELD NAME="plugin" TYPE="char" LENGTH="100" NOTNULL="true" DEFAULT="core" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="name"/>
19 <FIELD NAME="name" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="plugin" NEXT="value"/>
20 <FIELD NAME="value" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="name"/>
21 </FIELDS>
22 <KEYS>
23 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for config_plugins" NEXT="plugin_name"/>
24 <KEY NAME="plugin_name" TYPE="unique" FIELDS="plugin, name" PREVIOUS="primary"/>
25 </KEYS>
26 </TABLE>
27 <TABLE NAME="course" COMMENT="Central course table" PREVIOUS="config_plugins" NEXT="course_categories">
28 <FIELDS>
29 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="category"/>
30 <FIELD NAME="category" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="sortorder"/>
31 <FIELD NAME="sortorder" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="category" NEXT="password"/>
32 <FIELD NAME="password" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="sortorder" NEXT="fullname"/>
33 <FIELD NAME="fullname" TYPE="char" LENGTH="254" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="password" NEXT="shortname"/>
34 <FIELD NAME="shortname" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="fullname" NEXT="idnumber"/>
35 <FIELD NAME="idnumber" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="shortname" NEXT="summary"/>
36 <FIELD NAME="summary" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="idnumber" NEXT="format"/>
37 <FIELD NAME="format" TYPE="char" LENGTH="10" NOTNULL="true" DEFAULT="topics" SEQUENCE="false" ENUM="false" PREVIOUS="summary" NEXT="showgrades"/>
38 <FIELD NAME="showgrades" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="format" NEXT="modinfo"/>
39 <FIELD NAME="modinfo" TYPE="text" LENGTH="big" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="showgrades" NEXT="newsitems"/>
40 <FIELD NAME="newsitems" TYPE="int" LENGTH="5" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="modinfo" NEXT="teacher"/>
41 <FIELD NAME="teacher" TYPE="char" LENGTH="100" NOTNULL="true" DEFAULT="Teacher" SEQUENCE="false" ENUM="false" PREVIOUS="newsitems" NEXT="teachers"/>
42 <FIELD NAME="teachers" TYPE="char" LENGTH="100" NOTNULL="true" DEFAULT="Teachers" SEQUENCE="false" ENUM="false" PREVIOUS="teacher" NEXT="student"/>
43 <FIELD NAME="student" TYPE="char" LENGTH="100" NOTNULL="true" DEFAULT="Student" SEQUENCE="false" ENUM="false" PREVIOUS="teachers" NEXT="students"/>
44 <FIELD NAME="students" TYPE="char" LENGTH="100" NOTNULL="true" DEFAULT="Students" SEQUENCE="false" ENUM="false" PREVIOUS="student" NEXT="guest"/>
45 <FIELD NAME="guest" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="students" NEXT="startdate"/>
46 <FIELD NAME="startdate" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="guest" NEXT="enrolperiod"/>
47 <FIELD NAME="enrolperiod" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="startdate" NEXT="numsections"/>
48 <FIELD NAME="numsections" TYPE="int" LENGTH="5" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="enrolperiod" NEXT="marker"/>
49 <FIELD NAME="marker" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="numsections" NEXT="maxbytes"/>
50 <FIELD NAME="maxbytes" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="marker" NEXT="showreports"/>
51 <FIELD NAME="showreports" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="maxbytes" NEXT="visible"/>
52 <FIELD NAME="visible" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="showreports" NEXT="hiddensections"/>
53 <FIELD NAME="hiddensections" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="visible" NEXT="groupmode"/>
54 <FIELD NAME="groupmode" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="hiddensections" NEXT="groupmodeforce"/>
55 <FIELD NAME="groupmodeforce" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="groupmode" NEXT="lang"/>
56 <FIELD NAME="lang" TYPE="char" LENGTH="10" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="groupmodeforce" NEXT="theme"/>
57 <FIELD NAME="theme" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="lang" NEXT="cost"/>
58 <FIELD NAME="cost" TYPE="char" LENGTH="10" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="theme" NEXT="currency"/>
59 <FIELD NAME="currency" TYPE="char" LENGTH="3" NOTNULL="true" DEFAULT="USD" SEQUENCE="false" ENUM="false" PREVIOUS="cost" NEXT="timecreated"/>
60 <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="currency" NEXT="timemodified"/>
61 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timecreated" NEXT="metacourse"/>
62 <FIELD NAME="metacourse" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timemodified" NEXT="requested"/>
63 <FIELD NAME="requested" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="metacourse" NEXT="restrictmodules"/>
64 <FIELD NAME="restrictmodules" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="requested" NEXT="expirynotify"/>
65 <FIELD NAME="expirynotify" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="restrictmodules" NEXT="expirythreshold"/>
66 <FIELD NAME="expirythreshold" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="expirynotify" NEXT="notifystudents"/>
67 <FIELD NAME="notifystudents" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="expirythreshold" NEXT="enrollable"/>
68 <FIELD NAME="enrollable" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="notifystudents" NEXT="enrolstartdate"/>
69 <FIELD NAME="enrolstartdate" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="enrollable" NEXT="enrolenddate"/>
70 <FIELD NAME="enrolenddate" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="enrolstartdate" NEXT="enrol"/>
71 <FIELD NAME="enrol" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="enrolenddate"/>
72 </FIELDS>
73 <KEYS>
74 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for course"/>
75 </KEYS>
76 <INDEXES>
77 <INDEX NAME="category" UNIQUE="false" FIELDS="category" NEXT="idnumber"/>
78 <INDEX NAME="idnumber" UNIQUE="false" FIELDS="idnumber" PREVIOUS="category" NEXT="shortname"/>
79 <INDEX NAME="shortname" UNIQUE="false" FIELDS="shortname" PREVIOUS="idnumber"/>
80 </INDEXES>
81 </TABLE>
82 <TABLE NAME="course_categories" COMMENT="Course categories" PREVIOUS="course" NEXT="course_display">
83 <FIELDS>
84 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="name"/>
85 <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="description"/>
86 <FIELD NAME="description" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="parent"/>
87 <FIELD NAME="parent" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="description" NEXT="sortorder"/>
88 <FIELD NAME="sortorder" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="parent" NEXT="coursecount"/>
89 <FIELD NAME="coursecount" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="sortorder" NEXT="visible"/>
90 <FIELD NAME="visible" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="coursecount" NEXT="timemodified"/>
91 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="visible" NEXT="depth"/>
92 <FIELD NAME="depth" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timemodified" NEXT="path"/>
93 <FIELD NAME="path" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="depth"/>
94 </FIELDS>
95 <KEYS>
b08eda73 96 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for course_categories" NEXT="parent"/>
97 <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 98 </KEYS>
99 </TABLE>
100 <TABLE NAME="course_display" COMMENT="Stores info about how to display the course" PREVIOUS="course_categories" NEXT="course_meta">
101 <FIELDS>
102 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="course"/>
103 <FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="userid"/>
104 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="course" NEXT="display"/>
105 <FIELD NAME="display" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="userid"/>
106 </FIELDS>
107 <KEYS>
108 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for course_display"/>
109 </KEYS>
110 <INDEXES>
111 <INDEX NAME="course_userid" UNIQUE="false" FIELDS="course, userid"/>
112 </INDEXES>
113 </TABLE>
114 <TABLE NAME="course_meta" COMMENT="to store meta-courses relations" PREVIOUS="course_display" NEXT="course_modules">
115 <FIELDS>
116 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="parent_course"/>
117 <FIELD NAME="parent_course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="child_course"/>
118 <FIELD NAME="child_course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="parent_course"/>
119 </FIELDS>
120 <KEYS>
121 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for course_meta"/>
122 </KEYS>
123 <INDEXES>
124 <INDEX NAME="parent_course" UNIQUE="false" FIELDS="parent_course" NEXT="child_course"/>
125 <INDEX NAME="child_course" UNIQUE="false" FIELDS="child_course" PREVIOUS="parent_course"/>
126 </INDEXES>
127 </TABLE>
128 <TABLE NAME="course_modules" COMMENT="course_modules table retrofitted from MySQL" PREVIOUS="course_meta" NEXT="course_sections">
129 <FIELDS>
130 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="course"/>
131 <FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="module"/>
132 <FIELD NAME="module" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="course" NEXT="instance"/>
133 <FIELD NAME="instance" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="module" NEXT="section"/>
134 <FIELD NAME="section" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="instance" NEXT="added"/>
135 <FIELD NAME="added" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="section" NEXT="score"/>
136 <FIELD NAME="score" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="added" NEXT="indent"/>
137 <FIELD NAME="indent" TYPE="int" LENGTH="5" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="score" NEXT="visible"/>
138 <FIELD NAME="visible" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="indent" NEXT="visibleold"/>
139 <FIELD NAME="visibleold" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="visible" NEXT="groupmode"/>
140 <FIELD NAME="groupmode" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="visibleold"/>
141 </FIELDS>
142 <KEYS>
143 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for course_modules"/>
144 </KEYS>
145 <INDEXES>
146 <INDEX NAME="visible" UNIQUE="false" FIELDS="visible" NEXT="course"/>
147 <INDEX NAME="course" UNIQUE="false" FIELDS="course" PREVIOUS="visible" NEXT="module"/>
148 <INDEX NAME="module" UNIQUE="false" FIELDS="module" PREVIOUS="course" NEXT="instance"/>
149 <INDEX NAME="instance" UNIQUE="false" FIELDS="instance" PREVIOUS="module"/>
150 </INDEXES>
151 </TABLE>
152 <TABLE NAME="course_sections" COMMENT="to define the sections for each course" PREVIOUS="course_modules" NEXT="course_request">
153 <FIELDS>
154 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="course"/>
155 <FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="section"/>
156 <FIELD NAME="section" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="course" NEXT="summary"/>
157 <FIELD NAME="summary" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="section" NEXT="sequence"/>
158 <FIELD NAME="sequence" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="summary" NEXT="visible"/>
159 <FIELD NAME="visible" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="sequence"/>
160 </FIELDS>
161 <KEYS>
162 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for course_sections"/>
163 </KEYS>
164 <INDEXES>
165 <INDEX NAME="course_section" UNIQUE="false" FIELDS="course, section"/>
166 </INDEXES>
167 </TABLE>
168 <TABLE NAME="course_request" COMMENT="course requests" PREVIOUS="course_sections" NEXT="course_allowed_modules">
169 <FIELDS>
170 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="fullname"/>
171 <FIELD NAME="fullname" TYPE="char" LENGTH="254" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="shortname"/>
172 <FIELD NAME="shortname" TYPE="char" LENGTH="15" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="fullname" NEXT="summary"/>
173 <FIELD NAME="summary" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="shortname" NEXT="reason"/>
174 <FIELD NAME="reason" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="summary" NEXT="requester"/>
175 <FIELD NAME="requester" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="reason" NEXT="password"/>
176 <FIELD NAME="password" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="requester"/>
177 </FIELDS>
178 <KEYS>
179 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for course_request"/>
180 </KEYS>
181 <INDEXES>
182 <INDEX NAME="shortname" UNIQUE="false" FIELDS="shortname"/>
183 </INDEXES>
184 </TABLE>
185 <TABLE NAME="course_allowed_modules" COMMENT="allowed modules foreach course" PREVIOUS="course_request" NEXT="event">
186 <FIELDS>
187 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="course"/>
188 <FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="module"/>
189 <FIELD NAME="module" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="course"/>
190 </FIELDS>
191 <KEYS>
192 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for course_allowed_modules"/>
193 </KEYS>
194 <INDEXES>
195 <INDEX NAME="course" UNIQUE="false" FIELDS="course" NEXT="module"/>
196 <INDEX NAME="module" UNIQUE="false" FIELDS="module" PREVIOUS="course"/>
197 </INDEXES>
198 </TABLE>
199 <TABLE NAME="event" COMMENT="For everything with a time associated to it" PREVIOUS="course_allowed_modules" NEXT="cache_filters">
200 <FIELDS>
201 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="name"/>
202 <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="description"/>
203 <FIELD NAME="description" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="format"/>
204 <FIELD NAME="format" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="description" NEXT="courseid"/>
205 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="format" NEXT="groupid"/>
206 <FIELD NAME="groupid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="courseid" NEXT="userid"/>
207 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="groupid" NEXT="repeatid"/>
208 <FIELD NAME="repeatid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="modulename"/>
209 <FIELD NAME="modulename" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="repeatid" NEXT="instance"/>
210 <FIELD NAME="instance" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="modulename" NEXT="eventtype"/>
211 <FIELD NAME="eventtype" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="instance" NEXT="timestart"/>
212 <FIELD NAME="timestart" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="eventtype" NEXT="timeduration"/>
213 <FIELD NAME="timeduration" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timestart" NEXT="visible"/>
214 <FIELD NAME="visible" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="false" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="timeduration" NEXT="uuid"/>
215 <FIELD NAME="uuid" TYPE="char" LENGTH="36" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="visible" NEXT="sequence"/>
216 <FIELD NAME="sequence" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="uuid" NEXT="timemodified"/>
217 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="sequence"/>
218 </FIELDS>
219 <KEYS>
220 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for event"/>
221 </KEYS>
222 <INDEXES>
223 <INDEX NAME="courseid" UNIQUE="false" FIELDS="courseid" NEXT="userid"/>
224 <INDEX NAME="userid" UNIQUE="false" FIELDS="userid" PREVIOUS="courseid" NEXT="timestart"/>
225 <INDEX NAME="timestart" UNIQUE="false" FIELDS="timestart" PREVIOUS="userid" NEXT="timeduration"/>
226 <INDEX NAME="timeduration" UNIQUE="false" FIELDS="timeduration" PREVIOUS="timestart"/>
227 </INDEXES>
228 </TABLE>
229 <TABLE NAME="cache_filters" COMMENT="For keeping information about cached data" PREVIOUS="event" NEXT="cache_text">
230 <FIELDS>
231 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="filter"/>
232 <FIELD NAME="filter" TYPE="char" LENGTH="32" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="version"/>
233 <FIELD NAME="version" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="filter" NEXT="md5key"/>
234 <FIELD NAME="md5key" TYPE="char" LENGTH="32" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="version" NEXT="rawtext"/>
235 <FIELD NAME="rawtext" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="md5key" NEXT="timemodified"/>
236 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="rawtext"/>
237 </FIELDS>
238 <KEYS>
239 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for cache_filters"/>
240 </KEYS>
241 <INDEXES>
242 <INDEX NAME="filter_md5key" UNIQUE="false" FIELDS="filter, md5key"/>
243 </INDEXES>
244 </TABLE>
245 <TABLE NAME="cache_text" COMMENT="For storing temporary copies of processed texts" PREVIOUS="cache_filters" NEXT="grade_category">
246 <FIELDS>
247 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="md5key"/>
248 <FIELD NAME="md5key" TYPE="char" LENGTH="32" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="formattedtext"/>
249 <FIELD NAME="formattedtext" TYPE="binary" LENGTH="big" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="md5key" NEXT="timemodified"/>
250 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="formattedtext"/>
251 </FIELDS>
252 <KEYS>
253 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for cache_text"/>
254 </KEYS>
255 <INDEXES>
256 <INDEX NAME="md5key" UNIQUE="false" FIELDS="md5key"/>
257 </INDEXES>
258 </TABLE>
259 <TABLE NAME="grade_category" COMMENT="to define categories to group activity grades" PREVIOUS="cache_text" NEXT="grade_exceptions">
260 <FIELDS>
261 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="name"/>
262 <FIELD NAME="name" TYPE="char" LENGTH="64" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="courseid"/>
263 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="drop_x_lowest"/>
264 <FIELD NAME="drop_x_lowest" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="courseid" NEXT="bonus_points"/>
265 <FIELD NAME="bonus_points" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="drop_x_lowest" NEXT="hidden"/>
266 <FIELD NAME="hidden" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="bonus_points" NEXT="weight"/>
267 <FIELD NAME="weight" TYPE="number" LENGTH="5" NOTNULL="true" UNSIGNED="false" DEFAULT="0.00" SEQUENCE="false" ENUM="false" DECIMALS="2" PREVIOUS="hidden"/>
268 </FIELDS>
269 <KEYS>
270 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for grade_category"/>
271 </KEYS>
272 <INDEXES>
273 <INDEX NAME="courseid" UNIQUE="false" FIELDS="courseid"/>
274 </INDEXES>
275 </TABLE>
276 <TABLE NAME="grade_exceptions" COMMENT="individual grades to be skipped for certain students" PREVIOUS="grade_category" NEXT="grade_item">
277 <FIELDS>
278 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="courseid"/>
279 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="grade_itemid"/>
280 <FIELD NAME="grade_itemid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="courseid" NEXT="userid"/>
281 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="grade_itemid"/>
282 </FIELDS>
283 <KEYS>
284 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for grade_exceptions"/>
285 </KEYS>
286 <INDEXES>
287 <INDEX NAME="courseid" UNIQUE="false" FIELDS="courseid"/>
288 </INDEXES>
289 </TABLE>
290 <TABLE NAME="grade_item" COMMENT="items to be graded" PREVIOUS="grade_exceptions" NEXT="grade_letter">
291 <FIELDS>
292 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="courseid"/>
293 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="category"/>
294 <FIELD NAME="category" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="courseid" NEXT="modid"/>
295 <FIELD NAME="modid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="category" NEXT="cminstance"/>
296 <FIELD NAME="cminstance" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="modid" NEXT="scale_grade"/>
297 <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"/>
298 <FIELD NAME="extra_credit" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="scale_grade" NEXT="sort_order"/>
299 <FIELD NAME="sort_order" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="extra_credit"/>
300 </FIELDS>
301 <KEYS>
302 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for grade_item"/>
303 </KEYS>
304 <INDEXES>
305 <INDEX NAME="courseid" UNIQUE="false" FIELDS="courseid"/>
306 </INDEXES>
307 </TABLE>
308 <TABLE NAME="grade_letter" COMMENT="to convert numerical grades to letter grades" PREVIOUS="grade_item" NEXT="grade_preferences">
309 <FIELDS>
310 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="courseid"/>
311 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="letter"/>
312 <FIELD NAME="letter" TYPE="char" LENGTH="8" NOTNULL="true" DEFAULT="NA" SEQUENCE="false" ENUM="false" PREVIOUS="courseid" NEXT="grade_high"/>
313 <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"/>
314 <FIELD NAME="grade_low" TYPE="number" LENGTH="5" NOTNULL="true" UNSIGNED="false" DEFAULT="0.00" SEQUENCE="false" ENUM="false" DECIMALS="2" PREVIOUS="grade_high"/>
315 </FIELDS>
316 <KEYS>
317 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for grade_letter"/>
318 </KEYS>
319 <INDEXES>
320 <INDEX NAME="courseid" UNIQUE="false" FIELDS="courseid"/>
321 </INDEXES>
322 </TABLE>
323 <TABLE NAME="grade_preferences" COMMENT="Preferences of the gradebook for each course" PREVIOUS="grade_letter" NEXT="groups">
324 <FIELDS>
325 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="courseid"/>
326 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="preference"/>
327 <FIELD NAME="preference" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="courseid" NEXT="value"/>
328 <FIELD NAME="value" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="preference"/>
329 </FIELDS>
330 <KEYS>
331 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for grade_preferences"/>
332 </KEYS>
333 <INDEXES>
334 <INDEX NAME="courseid-preference" UNIQUE="true" FIELDS="courseid, preference"/>
335 </INDEXES>
336 </TABLE>
337 <TABLE NAME="groups" COMMENT="Each record is a group in a course" PREVIOUS="grade_preferences" NEXT="groups_members">
338 <FIELDS>
339 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="courseid"/>
340 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="name"/>
341 <FIELD NAME="name" TYPE="char" LENGTH="254" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="courseid" NEXT="description"/>
342 <FIELD NAME="description" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="password"/>
343 <FIELD NAME="password" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="description" NEXT="lang"/>
344 <FIELD NAME="lang" TYPE="char" LENGTH="10" NOTNULL="true" DEFAULT="en" SEQUENCE="false" ENUM="false" PREVIOUS="password" NEXT="theme"/>
345 <FIELD NAME="theme" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="lang" NEXT="picture"/>
346 <FIELD NAME="picture" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="theme" NEXT="hidepicture"/>
347 <FIELD NAME="hidepicture" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="picture" NEXT="timecreated"/>
348 <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="hidepicture" NEXT="timemodified"/>
349 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timecreated"/>
350 </FIELDS>
351 <KEYS>
352 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for groups"/>
353 </KEYS>
354 <INDEXES>
355 <INDEX NAME="courseid" UNIQUE="false" FIELDS="courseid"/>
356 </INDEXES>
357 </TABLE>
358 <TABLE NAME="groups_members" COMMENT="Lists memberships of users to groups" PREVIOUS="groups" NEXT="log">
359 <FIELDS>
360 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="groupid"/>
361 <FIELD NAME="groupid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="userid"/>
362 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="groupid" NEXT="timeadded"/>
363 <FIELD NAME="timeadded" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="userid"/>
364 </FIELDS>
365 <KEYS>
366 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for groups_members"/>
367 </KEYS>
368 <INDEXES>
369 <INDEX NAME="groupid" UNIQUE="false" FIELDS="groupid" NEXT="userid"/>
370 <INDEX NAME="userid" UNIQUE="false" FIELDS="userid" PREVIOUS="groupid"/>
371 </INDEXES>
372 </TABLE>
373 <TABLE NAME="log" COMMENT="Every action is logged as far as possible" PREVIOUS="groups_members" NEXT="log_display">
374 <FIELDS>
375 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="time"/>
376 <FIELD NAME="time" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="userid"/>
377 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="time" NEXT="ip"/>
378 <FIELD NAME="ip" TYPE="char" LENGTH="15" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="course"/>
379 <FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="ip" NEXT="module"/>
380 <FIELD NAME="module" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="course" NEXT="cmid"/>
381 <FIELD NAME="cmid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="module" NEXT="action"/>
382 <FIELD NAME="action" TYPE="char" LENGTH="40" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="cmid" NEXT="url"/>
383 <FIELD NAME="url" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="action" NEXT="info"/>
384 <FIELD NAME="info" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="url"/>
385 </FIELDS>
386 <KEYS>
387 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for log"/>
388 </KEYS>
389 <INDEXES>
390 <INDEX NAME="time-course-module-action" UNIQUE="false" FIELDS="time, course, module, action" NEXT="course-module-action"/>
391 <INDEX NAME="course-module-action" UNIQUE="false" FIELDS="course, module, action" PREVIOUS="time-course-module-action" NEXT="course-userid"/>
392 <INDEX NAME="course-userid" UNIQUE="false" FIELDS="course, userid" PREVIOUS="course-module-action" NEXT="userid"/>
393 <INDEX NAME="userid" UNIQUE="false" FIELDS="userid" PREVIOUS="course-userid" NEXT="info"/>
394 <INDEX NAME="info" UNIQUE="false" FIELDS="info" PREVIOUS="userid"/>
395 </INDEXES>
396 </TABLE>
397 <TABLE NAME="log_display" COMMENT="For a particular module/action, specifies a moodle table/field" PREVIOUS="log" NEXT="message">
398 <FIELDS>
399 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="module"/>
400 <FIELD NAME="module" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="action"/>
401 <FIELD NAME="action" TYPE="char" LENGTH="40" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="module" NEXT="mtable"/>
402 <FIELD NAME="mtable" TYPE="char" LENGTH="30" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="action" NEXT="field"/>
403 <FIELD NAME="field" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="mtable"/>
404 </FIELDS>
405 <KEYS>
406 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for log_display"/>
407 </KEYS>
408 <INDEXES>
409 <INDEX NAME="module-action" UNIQUE="true" FIELDS="module, action"/>
410 </INDEXES>
411 </TABLE>
412 <TABLE NAME="message" COMMENT="Stores all unread messages" PREVIOUS="log_display" NEXT="message_read">
413 <FIELDS>
414 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="useridfrom"/>
415 <FIELD NAME="useridfrom" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="useridto"/>
416 <FIELD NAME="useridto" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="useridfrom" NEXT="message"/>
417 <FIELD NAME="message" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="useridto" NEXT="format"/>
418 <FIELD NAME="format" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="message" NEXT="timecreated"/>
419 <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="format" NEXT="messagetype"/>
420 <FIELD NAME="messagetype" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="timecreated"/>
421 </FIELDS>
422 <KEYS>
423 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for message"/>
424 </KEYS>
425 <INDEXES>
426 <INDEX NAME="useridfrom" UNIQUE="false" FIELDS="useridfrom" NEXT="useridto"/>
427 <INDEX NAME="useridto" UNIQUE="false" FIELDS="useridto" PREVIOUS="useridfrom"/>
428 </INDEXES>
429 </TABLE>
430 <TABLE NAME="message_read" COMMENT="Stores all messages that have been read" PREVIOUS="message" NEXT="message_contacts">
431 <FIELDS>
432 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="useridfrom"/>
433 <FIELD NAME="useridfrom" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="useridto"/>
434 <FIELD NAME="useridto" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="useridfrom" NEXT="message"/>
435 <FIELD NAME="message" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="useridto" NEXT="format"/>
436 <FIELD NAME="format" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="message" NEXT="timecreated"/>
437 <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="format" NEXT="timeread"/>
438 <FIELD NAME="timeread" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timecreated" NEXT="messagetype"/>
439 <FIELD NAME="messagetype" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="timeread" NEXT="mailed"/>
440 <FIELD NAME="mailed" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="messagetype"/>
441 </FIELDS>
442 <KEYS>
443 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for message_read"/>
444 </KEYS>
445 <INDEXES>
446 <INDEX NAME="useridfrom" UNIQUE="false" FIELDS="useridfrom" NEXT="useridto"/>
447 <INDEX NAME="useridto" UNIQUE="false" FIELDS="useridto" PREVIOUS="useridfrom"/>
448 </INDEXES>
449 </TABLE>
450 <TABLE NAME="message_contacts" COMMENT="Maintains lists of relationships between users" PREVIOUS="message_read" NEXT="modules">
451 <FIELDS>
452 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="userid"/>
453 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="contactid"/>
454 <FIELD NAME="contactid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="blocked"/>
455 <FIELD NAME="blocked" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="contactid"/>
456 </FIELDS>
457 <KEYS>
458 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for message_contacts"/>
459 </KEYS>
460 <INDEXES>
461 <INDEX NAME="userid-contactid" UNIQUE="true" FIELDS="userid, contactid"/>
462 </INDEXES>
463 </TABLE>
464 <TABLE NAME="modules" COMMENT="modules available in the site" PREVIOUS="message_contacts" NEXT="scale">
465 <FIELDS>
466 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="name"/>
467 <FIELD NAME="name" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="version"/>
468 <FIELD NAME="version" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="cron"/>
469 <FIELD NAME="cron" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="version" NEXT="lastcron"/>
470 <FIELD NAME="lastcron" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="cron" NEXT="search"/>
471 <FIELD NAME="search" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="lastcron" NEXT="visible"/>
472 <FIELD NAME="visible" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="search"/>
473 </FIELDS>
474 <KEYS>
475 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for modules"/>
476 </KEYS>
477 <INDEXES>
478 <INDEX NAME="name" UNIQUE="false" FIELDS="name"/>
479 </INDEXES>
480 </TABLE>
481 <TABLE NAME="scale" COMMENT="Defines grading scales" PREVIOUS="modules" NEXT="sessions">
482 <FIELDS>
483 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="courseid"/>
484 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="userid"/>
485 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="courseid" NEXT="name"/>
486 <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="scale"/>
487 <FIELD NAME="scale" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="description"/>
488 <FIELD NAME="description" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="scale" NEXT="timemodified"/>
489 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="description"/>
490 </FIELDS>
491 <KEYS>
492 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for scale"/>
493 </KEYS>
494 <INDEXES>
495 <INDEX NAME="courseid" UNIQUE="false" FIELDS="courseid"/>
496 </INDEXES>
497 </TABLE>
498 <TABLE NAME="sessions" COMMENT="Optional database session storage, not used by default" PREVIOUS="scale" NEXT="timezone">
499 <FIELDS>
500 <FIELD NAME="sesskey" TYPE="char" LENGTH="32" NOTNULL="true" SEQUENCE="false" ENUM="false" NEXT="expiry"/>
501 <FIELD NAME="expiry" TYPE="int" LENGTH="11" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="sesskey" NEXT="expireref"/>
502 <FIELD NAME="expireref" TYPE="char" LENGTH="64" NOTNULL="false" SEQUENCE="false" ENUM="false" PREVIOUS="expiry" NEXT="data"/>
503 <FIELD NAME="data" TYPE="text" LENGTH="medium" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="expireref"/>
504 </FIELDS>
505 <KEYS>
506 <KEY NAME="primary" TYPE="primary" FIELDS="sesskey" COMMENT="Primary key for sessions"/>
507 </KEYS>
508 <INDEXES>
509 <INDEX NAME="expiry" UNIQUE="false" FIELDS="expiry"/>
510 </INDEXES>
511 </TABLE>
512 <TABLE NAME="timezone" COMMENT="Rules for calculating local wall clock time for users" PREVIOUS="sessions" NEXT="user">
513 <FIELDS>
514 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="true" ENUM="false" NEXT="name"/>
515 <FIELD NAME="name" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="year"/>
516 <FIELD NAME="year" TYPE="int" LENGTH="11" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="rule"/>
517 <FIELD NAME="rule" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="year" NEXT="gmtoff"/>
518 <FIELD NAME="gmtoff" TYPE="int" LENGTH="11" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="rule" NEXT="dstoff"/>
519 <FIELD NAME="dstoff" TYPE="int" LENGTH="11" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="gmtoff" NEXT="dst_month"/>
520 <FIELD NAME="dst_month" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="dstoff" NEXT="dst_startday"/>
521 <FIELD NAME="dst_startday" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="dst_month" NEXT="dst_weekday"/>
522 <FIELD NAME="dst_weekday" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="dst_startday" NEXT="dst_skipweeks"/>
523 <FIELD NAME="dst_skipweeks" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="dst_weekday" NEXT="dst_time"/>
524 <FIELD NAME="dst_time" TYPE="char" LENGTH="5" NOTNULL="true" DEFAULT="00:00" SEQUENCE="false" ENUM="false" PREVIOUS="dst_skipweeks" NEXT="std_month"/>
525 <FIELD NAME="std_month" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="dst_time" NEXT="std_startday"/>
526 <FIELD NAME="std_startday" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="std_month" NEXT="std_weekday"/>
527 <FIELD NAME="std_weekday" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="std_startday" NEXT="std_skipweeks"/>
528 <FIELD NAME="std_skipweeks" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="std_weekday" NEXT="std_time"/>
529 <FIELD NAME="std_time" TYPE="char" LENGTH="5" NOTNULL="true" DEFAULT="00:00" SEQUENCE="false" ENUM="false" PREVIOUS="std_skipweeks"/>
530 </FIELDS>
531 <KEYS>
532 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for timezone"/>
533 </KEYS>
534 </TABLE>
535 <TABLE NAME="user" COMMENT="One record for each person" PREVIOUS="timezone" NEXT="user_admins">
536 <FIELDS>
537 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="auth"/>
538 <FIELD NAME="auth" TYPE="char" LENGTH="20" NOTNULL="true" DEFAULT="manual" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="confirmed"/>
539 <FIELD NAME="confirmed" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="auth" NEXT="policyagreed"/>
540 <FIELD NAME="policyagreed" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="confirmed" NEXT="deleted"/>
541 <FIELD NAME="deleted" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="policyagreed" NEXT="username"/>
542 <FIELD NAME="username" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="deleted" NEXT="password"/>
543 <FIELD NAME="password" TYPE="char" LENGTH="32" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="username" NEXT="idnumber"/>
544 <FIELD NAME="idnumber" TYPE="char" LENGTH="64" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="password" NEXT="firstname"/>
545 <FIELD NAME="firstname" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="idnumber" NEXT="lastname"/>
546 <FIELD NAME="lastname" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="firstname" NEXT="email"/>
547 <FIELD NAME="email" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="lastname" NEXT="emailstop"/>
548 <FIELD NAME="emailstop" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="email" NEXT="icq"/>
549 <FIELD NAME="icq" TYPE="char" LENGTH="15" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="emailstop" NEXT="skype"/>
550 <FIELD NAME="skype" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="icq" NEXT="yahoo"/>
551 <FIELD NAME="yahoo" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="skype" NEXT="aim"/>
552 <FIELD NAME="aim" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="yahoo" NEXT="msn"/>
553 <FIELD NAME="msn" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="aim" NEXT="phone1"/>
554 <FIELD NAME="phone1" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="msn" NEXT="phone2"/>
555 <FIELD NAME="phone2" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="phone1" NEXT="institution"/>
556 <FIELD NAME="institution" TYPE="char" LENGTH="40" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="phone2" NEXT="department"/>
557 <FIELD NAME="department" TYPE="char" LENGTH="30" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="institution" NEXT="address"/>
558 <FIELD NAME="address" TYPE="char" LENGTH="70" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="department" NEXT="city"/>
559 <FIELD NAME="city" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="address" NEXT="country"/>
560 <FIELD NAME="country" TYPE="char" LENGTH="2" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="city" NEXT="lang"/>
561 <FIELD NAME="lang" TYPE="char" LENGTH="10" NOTNULL="true" DEFAULT="en" SEQUENCE="false" ENUM="false" PREVIOUS="country" NEXT="theme"/>
562 <FIELD NAME="theme" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="lang" NEXT="timezone"/>
563 <FIELD NAME="timezone" TYPE="char" LENGTH="100" NOTNULL="true" DEFAULT="99" SEQUENCE="false" ENUM="false" PREVIOUS="theme" NEXT="firstaccess"/>
564 <FIELD NAME="firstaccess" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timezone" NEXT="lastaccess"/>
565 <FIELD NAME="lastaccess" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="firstaccess" NEXT="lastlogin"/>
566 <FIELD NAME="lastlogin" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="lastaccess" NEXT="currentlogin"/>
567 <FIELD NAME="currentlogin" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="lastlogin" NEXT="lastip"/>
568 <FIELD NAME="lastip" TYPE="char" LENGTH="15" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="currentlogin" NEXT="secret"/>
569 <FIELD NAME="secret" TYPE="char" LENGTH="15" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="lastip" NEXT="picture"/>
570 <FIELD NAME="picture" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="secret" NEXT="url"/>
571 <FIELD NAME="url" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="picture" NEXT="description"/>
572 <FIELD NAME="description" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="url" NEXT="mailformat"/>
573 <FIELD NAME="mailformat" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="description" NEXT="maildigest"/>
574 <FIELD NAME="maildigest" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="mailformat" NEXT="maildisplay"/>
575 <FIELD NAME="maildisplay" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="2" SEQUENCE="false" ENUM="false" PREVIOUS="maildigest" NEXT="htmleditor"/>
576 <FIELD NAME="htmleditor" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="maildisplay" NEXT="autosubscribe"/>
577 <FIELD NAME="autosubscribe" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="htmleditor" NEXT="trackforums"/>
578 <FIELD NAME="trackforums" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="autosubscribe" NEXT="timemodified"/>
579 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="trackforums"/>
580 </FIELDS>
581 <KEYS>
582 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for user"/>
583 </KEYS>
584 <INDEXES>
585 <INDEX NAME="username" UNIQUE="true" FIELDS="username" NEXT="deleted"/>
586 <INDEX NAME="deleted" UNIQUE="false" FIELDS="deleted" PREVIOUS="username" NEXT="confirmed"/>
587 <INDEX NAME="confirmed" UNIQUE="false" FIELDS="confirmed" PREVIOUS="deleted" NEXT="firstname"/>
588 <INDEX NAME="firstname" UNIQUE="false" FIELDS="firstname" PREVIOUS="confirmed" NEXT="lastname"/>
589 <INDEX NAME="lastname" UNIQUE="false" FIELDS="lastname" PREVIOUS="firstname" NEXT="city"/>
590 <INDEX NAME="city" UNIQUE="false" FIELDS="city" PREVIOUS="lastname" NEXT="country"/>
591 <INDEX NAME="country" UNIQUE="false" FIELDS="country" PREVIOUS="city" NEXT="lastaccess"/>
592 <INDEX NAME="lastaccess" UNIQUE="false" FIELDS="lastaccess" PREVIOUS="country" NEXT="email"/>
593 <INDEX NAME="email" UNIQUE="false" FIELDS="email" PREVIOUS="lastaccess" NEXT="auth"/>
594 <INDEX NAME="auth" UNIQUE="false" FIELDS="auth" PREVIOUS="email" NEXT="idnumber"/>
595 <INDEX NAME="idnumber" UNIQUE="false" FIELDS="idnumber" PREVIOUS="auth"/>
596 </INDEXES>
597 </TABLE>
598 <TABLE NAME="user_admins" COMMENT="One record per administrator user" PREVIOUS="user" NEXT="user_preferences">
599 <FIELDS>
600 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="userid"/>
601 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id"/>
602 </FIELDS>
603 <KEYS>
604 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for user_admins"/>
605 </KEYS>
606 <INDEXES>
607 <INDEX NAME="userid" UNIQUE="true" FIELDS="userid"/>
608 </INDEXES>
609 </TABLE>
610 <TABLE NAME="user_preferences" COMMENT="Allows modules to store arbitrary user preferences" PREVIOUS="user_admins" NEXT="user_students">
611 <FIELDS>
612 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="userid"/>
613 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="name"/>
614 <FIELD NAME="name" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="value"/>
615 <FIELD NAME="value" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="name"/>
616 </FIELDS>
617 <KEYS>
618 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for user_preferences"/>
619 </KEYS>
620 <INDEXES>
621 <INDEX NAME="userid-name" UNIQUE="true" FIELDS="userid, name"/>
622 </INDEXES>
623 </TABLE>
624 <TABLE NAME="user_students" COMMENT="One record per student per course" PREVIOUS="user_preferences" NEXT="user_teachers">
625 <FIELDS>
626 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="userid"/>
627 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="course"/>
628 <FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="timestart"/>
629 <FIELD NAME="timestart" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="course" NEXT="timeend"/>
630 <FIELD NAME="timeend" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timestart" NEXT="time"/>
631 <FIELD NAME="time" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timeend" NEXT="timeaccess"/>
632 <FIELD NAME="timeaccess" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="time" NEXT="enrol"/>
633 <FIELD NAME="enrol" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="timeaccess"/>
634 </FIELDS>
635 <KEYS>
636 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for user_students"/>
637 </KEYS>
638 <INDEXES>
639 <INDEX NAME="course-userid" UNIQUE="true" FIELDS="course, userid" NEXT="userid"/>
640 <INDEX NAME="userid" UNIQUE="false" FIELDS="userid" PREVIOUS="course-userid" NEXT="enrol"/>
641 <INDEX NAME="enrol" UNIQUE="false" FIELDS="enrol" PREVIOUS="userid" NEXT="timeaccess"/>
642 <INDEX NAME="timeaccess" UNIQUE="false" FIELDS="timeaccess" PREVIOUS="enrol"/>
643 </INDEXES>
644 </TABLE>
645 <TABLE NAME="user_teachers" COMMENT="One record per teacher per course" PREVIOUS="user_students" NEXT="user_coursecreators">
646 <FIELDS>
647 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="userid"/>
648 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="course"/>
649 <FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="authority"/>
650 <FIELD NAME="authority" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="3" SEQUENCE="false" ENUM="false" PREVIOUS="course" NEXT="role"/>
651 <FIELD NAME="role" TYPE="char" LENGTH="40" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="authority" NEXT="editall"/>
652 <FIELD NAME="editall" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="role" NEXT="timestart"/>
653 <FIELD NAME="timestart" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="editall" NEXT="timeend"/>
654 <FIELD NAME="timeend" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timestart" NEXT="timemodified"/>
655 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timeend" NEXT="timeaccess"/>
656 <FIELD NAME="timeaccess" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timemodified" NEXT="enrol"/>
657 <FIELD NAME="enrol" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="timeaccess"/>
658 </FIELDS>
659 <KEYS>
660 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for user_teachers"/>
661 </KEYS>
662 <INDEXES>
663 <INDEX NAME="course-userid" UNIQUE="true" FIELDS="course, userid" COMMENT="Default comment for the index, please edit m" NEXT="userid"/>
664 <INDEX NAME="userid" UNIQUE="false" FIELDS="userid" PREVIOUS="course-userid" NEXT="enrol"/>
665 <INDEX NAME="enrol" UNIQUE="false" FIELDS="enrol" PREVIOUS="userid"/>
666 </INDEXES>
667 </TABLE>
668 <TABLE NAME="user_coursecreators" COMMENT="One record per course creator" PREVIOUS="user_teachers" NEXT="stats_daily">
669 <FIELDS>
670 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="userid"/>
671 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id"/>
672 </FIELDS>
673 <KEYS>
674 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for user_coursecreators"/>
675 </KEYS>
676 <INDEXES>
677 <INDEX NAME="userid" UNIQUE="true" FIELDS="userid"/>
678 </INDEXES>
679 </TABLE>
680 <TABLE NAME="stats_daily" COMMENT="to accumulate daily stats" PREVIOUS="user_coursecreators" NEXT="stats_weekly">
681 <FIELDS>
682 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="courseid"/>
683 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="timeend"/>
684 <FIELD NAME="timeend" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="courseid" NEXT="students"/>
685 <FIELD NAME="students" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timeend" NEXT="teachers"/>
686 <FIELD NAME="teachers" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="students" NEXT="activestudents"/>
687 <FIELD NAME="activestudents" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="teachers" NEXT="activeteachers"/>
688 <FIELD NAME="activeteachers" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="activestudents" NEXT="studentreads"/>
689 <FIELD NAME="studentreads" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="activeteachers" NEXT="studentwrites"/>
690 <FIELD NAME="studentwrites" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="studentreads" NEXT="teacherreads"/>
691 <FIELD NAME="teacherreads" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="studentwrites" NEXT="teacherwrites"/>
692 <FIELD NAME="teacherwrites" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="teacherreads" NEXT="logins"/>
693 <FIELD NAME="logins" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="teacherwrites" NEXT="uniquelogins"/>
694 <FIELD NAME="uniquelogins" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="logins"/>
695 </FIELDS>
696 <KEYS>
697 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for stats_daily"/>
698 </KEYS>
699 <INDEXES>
700 <INDEX NAME="courseid" UNIQUE="false" FIELDS="courseid" NEXT="timeend"/>
701 <INDEX NAME="timeend" UNIQUE="false" FIELDS="timeend" PREVIOUS="courseid"/>
702 </INDEXES>
703 </TABLE>
704 <TABLE NAME="stats_weekly" COMMENT="To accumulate weekly stats" PREVIOUS="stats_daily" NEXT="stats_monthly">
705 <FIELDS>
706 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="courseid"/>
707 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="timeend"/>
708 <FIELD NAME="timeend" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="courseid" NEXT="students"/>
709 <FIELD NAME="students" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timeend" NEXT="teachers"/>
710 <FIELD NAME="teachers" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="students" NEXT="activestudents"/>
711 <FIELD NAME="activestudents" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="teachers" NEXT="activeteachers"/>
712 <FIELD NAME="activeteachers" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="activestudents" NEXT="studentreads"/>
713 <FIELD NAME="studentreads" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="activeteachers" NEXT="studentwrites"/>
714 <FIELD NAME="studentwrites" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="studentreads" NEXT="teacherreads"/>
715 <FIELD NAME="teacherreads" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="studentwrites" NEXT="teacherwrites"/>
716 <FIELD NAME="teacherwrites" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="teacherreads" NEXT="logins"/>
717 <FIELD NAME="logins" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="teacherwrites" NEXT="uniquelogins"/>
718 <FIELD NAME="uniquelogins" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="logins"/>
719 </FIELDS>
720 <KEYS>
721 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for stats_weekly"/>
722 </KEYS>
723 <INDEXES>
724 <INDEX NAME="courseid" UNIQUE="false" FIELDS="courseid" NEXT="timeend"/>
725 <INDEX NAME="timeend" UNIQUE="false" FIELDS="timeend" PREVIOUS="courseid"/>
726 </INDEXES>
727 </TABLE>
728 <TABLE NAME="stats_monthly" COMMENT="To accumulate monthly stats" PREVIOUS="stats_weekly" NEXT="stats_user_daily">
729 <FIELDS>
730 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="courseid"/>
731 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="timeend"/>
732 <FIELD NAME="timeend" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="courseid" NEXT="students"/>
733 <FIELD NAME="students" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timeend" NEXT="teachers"/>
734 <FIELD NAME="teachers" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="students" NEXT="activestudents"/>
735 <FIELD NAME="activestudents" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="teachers" NEXT="activeteachers"/>
736 <FIELD NAME="activeteachers" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="activestudents" NEXT="studentreads"/>
737 <FIELD NAME="studentreads" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="activeteachers" NEXT="studentwrites"/>
738 <FIELD NAME="studentwrites" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="studentreads" NEXT="teacherreads"/>
739 <FIELD NAME="teacherreads" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="studentwrites" NEXT="teacherwrites"/>
740 <FIELD NAME="teacherwrites" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="teacherreads" NEXT="logins"/>
741 <FIELD NAME="logins" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="teacherwrites" NEXT="uniquelogins"/>
742 <FIELD NAME="uniquelogins" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="logins"/>
743 </FIELDS>
744 <KEYS>
745 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for stats_monthly"/>
746 </KEYS>
747 <INDEXES>
748 <INDEX NAME="courseid" UNIQUE="false" FIELDS="courseid" NEXT="timeend"/>
749 <INDEX NAME="timeend" UNIQUE="false" FIELDS="timeend" PREVIOUS="courseid"/>
750 </INDEXES>
751 </TABLE>
752 <TABLE NAME="stats_user_daily" COMMENT="To accumulate daily stats per course/user" PREVIOUS="stats_monthly" NEXT="stats_user_weekly">
753 <FIELDS>
754 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="courseid"/>
755 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="userid"/>
756 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="courseid" NEXT="roleid"/>
757 <FIELD NAME="roleid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="timeend"/>
758 <FIELD NAME="timeend" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="roleid" NEXT="statsreads"/>
759 <FIELD NAME="statsreads" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timeend" NEXT="statswrites"/>
760 <FIELD NAME="statswrites" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="statsreads" NEXT="stattype"/>
761 <FIELD NAME="stattype" TYPE="char" LENGTH="30" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="statswrites"/>
762 </FIELDS>
763 <KEYS>
764 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for stats_user_daily"/>
765 </KEYS>
766 <INDEXES>
767 <INDEX NAME="courseid" UNIQUE="false" FIELDS="courseid" NEXT="userid"/>
768 <INDEX NAME="userid" UNIQUE="false" FIELDS="userid" PREVIOUS="courseid" NEXT="roleid"/>
769 <INDEX NAME="roleid" UNIQUE="false" FIELDS="roleid" PREVIOUS="userid" NEXT="timeend"/>
770 <INDEX NAME="timeend" UNIQUE="false" FIELDS="timeend" PREVIOUS="roleid"/>
771 </INDEXES>
772 </TABLE>
773 <TABLE NAME="stats_user_weekly" COMMENT="To accumulate weekly stats per course/user" PREVIOUS="stats_user_daily" NEXT="stats_user_monthly">
774 <FIELDS>
775 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="courseid"/>
776 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="userid"/>
777 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="courseid" NEXT="roleid"/>
778 <FIELD NAME="roleid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="timeend"/>
779 <FIELD NAME="timeend" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="roleid" NEXT="statsreads"/>
780 <FIELD NAME="statsreads" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timeend" NEXT="statswrites"/>
781 <FIELD NAME="statswrites" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="statsreads" NEXT="stattype"/>
782 <FIELD NAME="stattype" TYPE="char" LENGTH="30" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="statswrites"/>
783 </FIELDS>
784 <KEYS>
785 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for stats_user_weekly"/>
786 </KEYS>
787 <INDEXES>
788 <INDEX NAME="courseid" UNIQUE="false" FIELDS="courseid" NEXT="userid"/>
789 <INDEX NAME="userid" UNIQUE="false" FIELDS="userid" PREVIOUS="courseid" NEXT="roleid"/>
790 <INDEX NAME="roleid" UNIQUE="false" FIELDS="roleid" PREVIOUS="userid" NEXT="timeend"/>
791 <INDEX NAME="timeend" UNIQUE="false" FIELDS="timeend" PREVIOUS="roleid"/>
792 </INDEXES>
793 </TABLE>
794 <TABLE NAME="stats_user_monthly" COMMENT="To accumulate monthly stats per course/user" PREVIOUS="stats_user_weekly" NEXT="post">
795 <FIELDS>
796 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="courseid"/>
797 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="userid"/>
798 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="courseid" NEXT="roleid"/>
799 <FIELD NAME="roleid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="timeend"/>
800 <FIELD NAME="timeend" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="roleid" NEXT="statsreads"/>
801 <FIELD NAME="statsreads" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timeend" NEXT="statswrites"/>
802 <FIELD NAME="statswrites" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="statsreads" NEXT="stattype"/>
803 <FIELD NAME="stattype" TYPE="char" LENGTH="30" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="statswrites"/>
804 </FIELDS>
805 <KEYS>
806 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for stats_user_monthly"/>
807 </KEYS>
808 <INDEXES>
809 <INDEX NAME="courseid" UNIQUE="false" FIELDS="courseid" NEXT="userid"/>
810 <INDEX NAME="userid" UNIQUE="false" FIELDS="userid" PREVIOUS="courseid" NEXT="roleid"/>
811 <INDEX NAME="roleid" UNIQUE="false" FIELDS="roleid" PREVIOUS="userid" NEXT="timeend"/>
812 <INDEX NAME="timeend" UNIQUE="false" FIELDS="timeend" PREVIOUS="roleid"/>
813 </INDEXES>
814 </TABLE>
815 <TABLE NAME="post" COMMENT="Generic post table to hold data blog entries etc in different modules" PREVIOUS="stats_user_monthly" NEXT="tags">
816 <FIELDS>
817 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="true" ENUM="false" NEXT="module"/>
818 <FIELD NAME="module" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="userid"/>
5a1d8354 819 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="module" NEXT="courseid"/>
820 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="groupid"/>
821 <FIELD NAME="groupid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="courseid" NEXT="moduleid"/>
822 <FIELD NAME="moduleid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="groupid" NEXT="coursemoduleid"/>
823 <FIELD NAME="coursemoduleid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="moduleid" NEXT="subject"/>
67d7d694 824 <FIELD NAME="subject" TYPE="char" LENGTH="128" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="coursemoduleid" NEXT="summary"/>
825 <FIELD NAME="summary" TYPE="text" LENGTH="big" NOTNULL="false" SEQUENCE="false" ENUM="false" PREVIOUS="subject" NEXT="content"/>
826 <FIELD NAME="content" TYPE="text" LENGTH="big" NOTNULL="false" SEQUENCE="false" ENUM="false" PREVIOUS="summary" NEXT="uniquehash"/>
827 <FIELD NAME="uniquehash" TYPE="char" LENGTH="128" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="content" NEXT="rating"/>
5a1d8354 828 <FIELD NAME="rating" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="uniquehash" NEXT="format"/>
829 <FIELD NAME="format" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="rating" NEXT="publishstate"/>
67d7d694 830 <FIELD NAME="publishstate" TYPE="char" LENGTH="20" NOTNULL="true" DEFAULT="draft" SEQUENCE="false" ENUM="true" ENUMVALUES="'draft', 'site', 'public'" PREVIOUS="format" NEXT="lastmodified"/>
5a1d8354 831 <FIELD NAME="lastmodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="publishstate" NEXT="created"/>
832 <FIELD NAME="created" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="lastmodified"/>
67d7d694 833 </FIELDS>
834 <KEYS>
835 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for post"/>
836 </KEYS>
837 <INDEXES>
838 <INDEX NAME="id-userid" UNIQUE="true" FIELDS="id, userid" NEXT="lastmodified"/>
839 <INDEX NAME="lastmodified" UNIQUE="false" FIELDS="lastmodified" PREVIOUS="id-userid" NEXT="module"/>
840 <INDEX NAME="module" UNIQUE="false" FIELDS="module" PREVIOUS="lastmodified" NEXT="subject"/>
841 <INDEX NAME="subject" UNIQUE="false" FIELDS="subject" PREVIOUS="module"/>
842 </INDEXES>
843 </TABLE>
844 <TABLE NAME="tags" COMMENT="tags structure for moodle" PREVIOUS="post" NEXT="blog_tag_instance">
845 <FIELDS>
5a1d8354 846 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="type"/>
67d7d694 847 <FIELD NAME="type" TYPE="char" LENGTH="255" NOTNULL="true" DEFAULT="official" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="userid"/>
5a1d8354 848 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="type" NEXT="text"/>
67d7d694 849 <FIELD NAME="text" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="userid"/>
850 </FIELDS>
851 <KEYS>
852 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for tags"/>
853 </KEYS>
854 <INDEXES>
855 <INDEX NAME="type-userid" UNIQUE="false" FIELDS="type, userid" NEXT="text"/>
856 <INDEX NAME="text" UNIQUE="false" FIELDS="text" PREVIOUS="type-userid"/>
857 </INDEXES>
858 </TABLE>
5a1d8354 859 <TABLE NAME="blog_tag_instance" COMMENT="tag instance for blogs" PREVIOUS="tags" NEXT="role">
67d7d694 860 <FIELDS>
5a1d8354 861 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="entryid"/>
862 <FIELD NAME="entryid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="tagid"/>
863 <FIELD NAME="tagid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="entryid" NEXT="groupid"/>
864 <FIELD NAME="groupid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="tagid" NEXT="courseid"/>
865 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="groupid" NEXT="userid"/>
866 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="courseid" NEXT="timemodified"/>
67d7d694 867 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="userid"/>
868 </FIELDS>
869 <KEYS>
870 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for blog_tag_instance"/>
871 </KEYS>
872 <INDEXES>
873 <INDEX NAME="entryid" UNIQUE="false" FIELDS="entryid" NEXT="tagid"/>
874 <INDEX NAME="tagid" UNIQUE="false" FIELDS="tagid" PREVIOUS="entryid"/>
875 </INDEXES>
876 </TABLE>
5a1d8354 877 <TABLE NAME="role" COMMENT="moodle roles" PREVIOUS="blog_tag_instance" NEXT="context">
878 <FIELDS>
879 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="name"/>
880 <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="description"/>
881 <FIELD NAME="description" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="sortorder"/>
882 <FIELD NAME="sortorder" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="description"/>
883 </FIELDS>
884 <KEYS>
885 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for role"/>
886 </KEYS>
a1bdf659 887 <INDEXES>
888 <INDEX NAME="sortorder" UNIQUE="false" FIELDS="sortorder"/>
889 </INDEXES>
5a1d8354 890 </TABLE>
a1bdf659 891 <TABLE NAME="context" COMMENT="one of these must be set" PREVIOUS="role" NEXT="capabilities">
5a1d8354 892 <FIELDS>
893 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="level"/>
894 <FIELD NAME="level" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="instanceid"/>
895 <FIELD NAME="instanceid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="level"/>
896 </FIELDS>
897 <KEYS>
898 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for context"/>
899 </KEYS>
a1bdf659 900 <INDEXES>
901 <INDEX NAME="level-instanceid" UNIQUE="true" FIELDS="level, instanceid" NEXT="instanceid"/>
902 <INDEX NAME="instanceid" UNIQUE="false" FIELDS="instanceid" PREVIOUS="level-instanceid"/>
903 </INDEXES>
904 </TABLE>
905 <TABLE NAME="capabilities" COMMENT="this defines all capabilities" PREVIOUS="context" NEXT="role_assignments">
906 <FIELDS>
907 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="name"/>
908 <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="captype"/>
909 <FIELD NAME="captype" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="contextlevel"/>
910 <FIELD NAME="contextlevel" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="captype" NEXT="component"/>
911 <FIELD NAME="component" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="contextlevel"/>
912 </FIELDS>
913 <KEYS>
914 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for capabilities" NEXT="name"/>
915 <KEY NAME="name" TYPE="unique" FIELDS="name" PREVIOUS="primary"/>
916 </KEYS>
5a1d8354 917 </TABLE>
a1bdf659 918 <TABLE NAME="role_assignments" COMMENT="assigning roles to different context" PREVIOUS="capabilities" NEXT="role_capabilities">
5a1d8354 919 <FIELDS>
920 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="roleid"/>
921 <FIELD NAME="roleid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="contextid"/>
922 <FIELD NAME="contextid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="roleid" NEXT="userid"/>
923 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="contextid" NEXT="hidden"/>
924 <FIELD NAME="hidden" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="timestart"/>
925 <FIELD NAME="timestart" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="hidden" NEXT="timeend"/>
926 <FIELD NAME="timeend" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timestart" NEXT="timemodified"/>
927 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timeend" NEXT="modifierid"/>
928 <FIELD NAME="modifierid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timemodified" NEXT="enrol"/>
929 <FIELD NAME="enrol" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="modifierid" NEXT="sortorder"/>
930 <FIELD NAME="sortorder" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="enrol"/>
931 </FIELDS>
932 <KEYS>
a1bdf659 933 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for role_assignments" NEXT="roleid"/>
934 <KEY NAME="roleid" TYPE="foreign" FIELDS="roleid" REFTABLE="role" REFFIELDS="id" PREVIOUS="primary" NEXT="contextid"/>
935 <KEY NAME="contextid" TYPE="foreign" FIELDS="contextid" REFTABLE="context" REFFIELDS="id" PREVIOUS="roleid" NEXT="userid"/>
936 <KEY NAME="userid" TYPE="foreign" FIELDS="userid" REFTABLE="user" REFFIELDS="id" PREVIOUS="contextid"/>
5a1d8354 937 </KEYS>
a1bdf659 938 <INDEXES>
939 <INDEX NAME="contextid-roleid-userid" UNIQUE="true" FIELDS="contextid, roleid, userid" NEXT="sortorder"/>
940 <INDEX NAME="sortorder" UNIQUE="false" FIELDS="sortorder" PREVIOUS="contextid-roleid-userid"/>
941 </INDEXES>
5a1d8354 942 </TABLE>
54121a79 943 <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_deny_grant">
5a1d8354 944 <FIELDS>
945 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="contextid"/>
946 <FIELD NAME="contextid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="roleid"/>
947 <FIELD NAME="roleid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="contextid" NEXT="capability"/>
948 <FIELD NAME="capability" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="roleid" NEXT="permission"/>
54121a79 949 <FIELD NAME="permission" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="capability" NEXT="timemodified"/>
5a1d8354 950 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="permission" NEXT="modifierid"/>
951 <FIELD NAME="modifierid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timemodified"/>
952 </FIELDS>
953 <KEYS>
a1bdf659 954 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for role_capabilities" NEXT="roleid"/>
955 <KEY NAME="roleid" TYPE="foreign" FIELDS="roleid" REFTABLE="role" REFFIELDS="id" PREVIOUS="primary" NEXT="contextid"/>
956 <KEY NAME="contextid" TYPE="foreign" FIELDS="contextid" REFTABLE="context" REFFIELDS="id" PREVIOUS="roleid" NEXT="modifierid"/>
957 <KEY NAME="modifierid" TYPE="foreign" FIELDS="modifierid" REFTABLE="user" REFFIELDS="id" PREVIOUS="contextid" NEXT="capability"/>
958 <KEY NAME="capability" TYPE="foreign" FIELDS="capability" REFTABLE="capabilities" REFFIELDS="name" PREVIOUS="modifierid"/>
5a1d8354 959 </KEYS>
a1bdf659 960 <INDEXES>
961 <INDEX NAME="roleid-contextid-capability" UNIQUE="true" FIELDS="roleid, contextid, capability"/>
962 </INDEXES>
5a1d8354 963 </TABLE>
a1bdf659 964 <TABLE NAME="role_deny_grant" COMMENT="this defines what role can touch (assign, override) what role" PREVIOUS="role_capabilities" NEXT="role_names">
5a1d8354 965 <FIELDS>
966 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="roleid"/>
967 <FIELD NAME="roleid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="unviewableroleid"/>
968 <FIELD NAME="unviewableroleid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="roleid"/>
969 </FIELDS>
970 <KEYS>
a1bdf659 971 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for role_deny_grant" NEXT="roleid"/>
972 <KEY NAME="roleid" TYPE="foreign" FIELDS="roleid" REFTABLE="role" REFFIELDS="id" PREVIOUS="primary" NEXT="unviewableroleid"/>
973 <KEY NAME="unviewableroleid" TYPE="foreign" FIELDS="unviewableroleid" REFTABLE="role" REFFIELDS="id" PREVIOUS="roleid"/>
5a1d8354 974 </KEYS>
a1bdf659 975 <INDEXES>
976 <INDEX NAME="roleid-unviewableroleid" UNIQUE="true" FIELDS="roleid, unviewableroleid"/>
977 </INDEXES>
5a1d8354 978 </TABLE>
a1bdf659 979 <TABLE NAME="role_names" COMMENT="role names in native strings" PREVIOUS="role_deny_grant">
5a1d8354 980 <FIELDS>
981 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="roleid"/>
982 <FIELD NAME="roleid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="contextid"/>
983 <FIELD NAME="contextid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="roleid" NEXT="text"/>
984 <FIELD NAME="text" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="contextid"/>
985 </FIELDS>
986 <KEYS>
a1bdf659 987 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for role_names" NEXT="roleid"/>
988 <KEY NAME="roleid" TYPE="foreign" FIELDS="roleid" REFTABLE="role" REFFIELDS="id" COMMENT="Default comment for the key, please edit me" PREVIOUS="primary" NEXT="contextid"/>
989 <KEY NAME="contextid" TYPE="foreign" FIELDS="contextid" REFTABLE="context" REFFIELDS="id" PREVIOUS="roleid"/>
5a1d8354 990 </KEYS>
a1bdf659 991 <INDEXES>
992 <INDEX NAME="roleid-contextid" UNIQUE="true" FIELDS="roleid, contextid"/>
993 </INDEXES>
5a1d8354 994 </TABLE>
67d7d694 995 </TABLES>
996 <STATEMENTS>
997 <STATEMENT NAME="insert log_display" TYPE="insert" TABLE="log_display" COMMENT="Initial insert of records on table log_display">
998 <SENTENCES>
999 <SENTENCE TEXT="(module, action, mtable, field) VALUES ('user', 'view', 'user', 'CONCAT(firstname,&quot; &quot;,lastname)')" />
1000 <SENTENCE TEXT="(module, action, mtable, field) VALUES ('course', 'user report', 'user', 'CONCAT(firstname,&quot; &quot;,lastname)')" />
1001 <SENTENCE TEXT="(module, action, mtable, field) VALUES ('course', 'view', 'course', 'fullname')" />
1002 <SENTENCE TEXT="(module, action, mtable, field) VALUES ('course', 'update', 'course', 'fullname')" />
1003 <SENTENCE TEXT="(module, action, mtable, field) VALUES ('course', 'enrol', 'course', 'fullname')" />
1004 <SENTENCE TEXT="(module, action, mtable, field) VALUES ('course', 'report log', 'course', 'fullname')" />
1005 <SENTENCE TEXT="(module, action, mtable, field) VALUES ('course', 'report live', 'course', 'fullname')" />
1006 <SENTENCE TEXT="(module, action, mtable, field) VALUES ('course', 'report outline', 'course', 'fullname')" />
1007 <SENTENCE TEXT="(module, action, mtable, field) VALUES ('course', 'report participation', 'course', 'fullname')" />
1008 <SENTENCE TEXT="(module, action, mtable, field) VALUES ('course', 'report stats', 'course', 'fullname')" />
1009 <SENTENCE TEXT="(module, action, mtable, field) VALUES ('message', 'write', 'user', 'CONCAT(firstname,&quot; &quot;,lastname)')" />
1010 <SENTENCE TEXT="(module, action, mtable, field) VALUES ('message', 'read', 'user', 'CONCAT(firstname,&quot; &quot;,lastname)')" />
1011 <SENTENCE TEXT="(module, action, mtable, field) VALUES ('message', 'add contact', 'user', 'CONCAT(firstname,&quot; &quot;,lastname)')" />
1012 <SENTENCE TEXT="(module, action, mtable, field) VALUES ('message', 'remove contact', 'user', 'CONCAT(firstname,&quot; &quot;,lastname)')" />
1013 <SENTENCE TEXT="(module, action, mtable, field) VALUES ('message', 'block contact', 'user', 'CONCAT(firstname,&quot; &quot;,lastname)')" />
1014 <SENTENCE TEXT="(module, action, mtable, field) VALUES ('message', 'unblock contact', 'user', 'CONCAT(firstname,&quot; &quot;,lastname)')" />
1015 </SENTENCES>
1016 </STATEMENT>
1017 </STATEMENTS>
1018</XMLDB>