course MDL-20628 Fixed up topics so section names are printed on view
[moodle.git] / lib / db / install.xml
CommitLineData
67d7d694 1<?xml version="1.0" encoding="UTF-8" ?>
80350ef6 2<XMLDB PATH="lib/db" VERSION="20100413" 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>
74c288a1 9 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="name"/>
10 <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="id" NEXT="value"/>
11 <FIELD NAME="value" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" PREVIOUS="name"/>
67d7d694 12 </FIELDS>
13 <KEYS>
28271c72 14 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="name"/>
67d7d694 15 <KEY NAME="name" TYPE="unique" FIELDS="name" PREVIOUS="primary"/>
16 </KEYS>
17 </TABLE>
5ac9b67c 18 <TABLE NAME="config_plugins" COMMENT="Moodle modules and plugins configuration variables" PREVIOUS="config" NEXT="config_log">
67d7d694 19 <FIELDS>
74c288a1 20 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="plugin"/>
21 <FIELD NAME="plugin" TYPE="char" LENGTH="100" NOTNULL="true" DEFAULT="core" SEQUENCE="false" PREVIOUS="id" NEXT="name"/>
22 <FIELD NAME="name" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" PREVIOUS="plugin" NEXT="value"/>
23 <FIELD NAME="value" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" PREVIOUS="name"/>
67d7d694 24 </FIELDS>
25 <KEYS>
28271c72 26 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="plugin_name"/>
67d7d694 27 <KEY NAME="plugin_name" TYPE="unique" FIELDS="plugin, name" PREVIOUS="primary"/>
28 </KEYS>
29 </TABLE>
1f20942c 30 <TABLE NAME="config_log" COMMENT="Changes done in server configuration through admin UI" PREVIOUS="config_plugins" NEXT="upgrade_log">
301bf0b2 31 <FIELDS>
74c288a1 32 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="userid"/>
33 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="id" NEXT="timemodified"/>
34 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="userid" NEXT="plugin"/>
35 <FIELD NAME="plugin" TYPE="char" LENGTH="100" NOTNULL="false" SEQUENCE="false" PREVIOUS="timemodified" NEXT="name"/>
36 <FIELD NAME="name" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" PREVIOUS="plugin" NEXT="value"/>
37 <FIELD NAME="value" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" PREVIOUS="name" NEXT="oldvalue"/>
38 <FIELD NAME="oldvalue" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" PREVIOUS="value"/>
301bf0b2 39 </FIELDS>
40 <KEYS>
41 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="userid"/>
42 <KEY NAME="userid" TYPE="foreign" FIELDS="userid" REFTABLE="user" REFFIELDS="id" PREVIOUS="primary"/>
43 </KEYS>
44 <INDEXES>
45 <INDEX NAME="timemodified" UNIQUE="false" FIELDS="timemodified"/>
46 </INDEXES>
47 </TABLE>
1f20942c 48 <TABLE NAME="upgrade_log" COMMENT="Upgrade logging" PREVIOUS="config_log" NEXT="course">
49 <FIELDS>
74c288a1 50 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="type"/>
51 <FIELD NAME="type" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="false" COMMENT="type: 0==info, 1==notice, 2==error" PREVIOUS="id" NEXT="plugin"/>
52 <FIELD NAME="plugin" TYPE="char" LENGTH="100" NOTNULL="false" SEQUENCE="false" PREVIOUS="type" NEXT="version"/>
53 <FIELD NAME="version" TYPE="char" LENGTH="100" NOTNULL="false" SEQUENCE="false" COMMENT="plugin or main version if known" PREVIOUS="plugin" NEXT="info"/>
54 <FIELD NAME="info" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="version" NEXT="details"/>
55 <FIELD NAME="details" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" PREVIOUS="info" NEXT="backtrace"/>
56 <FIELD NAME="backtrace" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" PREVIOUS="details" NEXT="userid"/>
57 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="backtrace" NEXT="timemodified"/>
58 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="userid"/>
1f20942c 59 </FIELDS>
60 <KEYS>
61 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="userid"/>
62 <KEY NAME="userid" TYPE="foreign" FIELDS="userid" REFTABLE="user" REFFIELDS="id" PREVIOUS="primary"/>
63 </KEYS>
64 <INDEXES>
65 <INDEX NAME="timemodified" UNIQUE="false" FIELDS="timemodified" NEXT="type-timemodified"/>
66 <INDEX NAME="type-timemodified" UNIQUE="false" FIELDS="type, timemodified" PREVIOUS="timemodified"/>
67 </INDEXES>
68 </TABLE>
69 <TABLE NAME="course" COMMENT="Central course table" PREVIOUS="upgrade_log" NEXT="course_categories">
67d7d694 70 <FIELDS>
74c288a1 71 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="category"/>
72 <FIELD NAME="category" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="sortorder"/>
73 <FIELD NAME="sortorder" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="category" NEXT="password"/>
74 <FIELD NAME="password" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" PREVIOUS="sortorder" NEXT="fullname"/>
75 <FIELD NAME="fullname" TYPE="char" LENGTH="254" NOTNULL="true" SEQUENCE="false" PREVIOUS="password" NEXT="shortname"/>
76 <FIELD NAME="shortname" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" PREVIOUS="fullname" NEXT="idnumber"/>
77 <FIELD NAME="idnumber" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" PREVIOUS="shortname" NEXT="summary"/>
8bdc9cac
SH
78 <FIELD NAME="summary" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" PREVIOUS="idnumber" NEXT="summaryformat"/>
79 <FIELD NAME="summaryformat" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="summary" NEXT="format"/>
80 <FIELD NAME="format" TYPE="char" LENGTH="10" NOTNULL="true" DEFAULT="topics" SEQUENCE="false" PREVIOUS="summaryformat" NEXT="showgrades"/>
74c288a1 81 <FIELD NAME="showgrades" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" PREVIOUS="format" NEXT="modinfo"/>
82 <FIELD NAME="modinfo" TYPE="text" LENGTH="big" NOTNULL="false" SEQUENCE="false" PREVIOUS="showgrades" NEXT="newsitems"/>
83 <FIELD NAME="newsitems" TYPE="int" LENGTH="5" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" PREVIOUS="modinfo" NEXT="guest"/>
84 <FIELD NAME="guest" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="newsitems" NEXT="startdate"/>
85 <FIELD NAME="startdate" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="guest" NEXT="enrolperiod"/>
86 <FIELD NAME="enrolperiod" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="startdate" NEXT="numsections"/>
87 <FIELD NAME="numsections" TYPE="int" LENGTH="5" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" PREVIOUS="enrolperiod" NEXT="marker"/>
88 <FIELD NAME="marker" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="numsections" NEXT="maxbytes"/>
89 <FIELD NAME="maxbytes" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="marker" NEXT="showreports"/>
90 <FIELD NAME="showreports" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="maxbytes" NEXT="visible"/>
91 <FIELD NAME="visible" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" PREVIOUS="showreports" NEXT="hiddensections"/>
92 <FIELD NAME="hiddensections" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="visible" NEXT="groupmode"/>
93 <FIELD NAME="groupmode" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="hiddensections" NEXT="groupmodeforce"/>
94 <FIELD NAME="groupmodeforce" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="groupmode" NEXT="defaultgroupingid"/>
95 <FIELD NAME="defaultgroupingid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="default grouping used in course modules, does not have key intentionally" PREVIOUS="groupmodeforce" NEXT="lang"/>
96 <FIELD NAME="lang" TYPE="char" LENGTH="30" NOTNULL="true" SEQUENCE="false" PREVIOUS="defaultgroupingid" NEXT="theme"/>
97 <FIELD NAME="theme" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" PREVIOUS="lang" NEXT="cost"/>
98 <FIELD NAME="cost" TYPE="char" LENGTH="10" NOTNULL="true" SEQUENCE="false" PREVIOUS="theme" NEXT="currency"/>
99 <FIELD NAME="currency" TYPE="char" LENGTH="3" NOTNULL="true" DEFAULT="USD" SEQUENCE="false" PREVIOUS="cost" NEXT="timecreated"/>
100 <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="currency" NEXT="timemodified"/>
101 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="timecreated" NEXT="metacourse"/>
102 <FIELD NAME="metacourse" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="timemodified" NEXT="requested"/>
103 <FIELD NAME="requested" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="metacourse" NEXT="restrictmodules"/>
104 <FIELD NAME="restrictmodules" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="requested" NEXT="expirynotify"/>
105 <FIELD NAME="expirynotify" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="restrictmodules" NEXT="expirythreshold"/>
106 <FIELD NAME="expirythreshold" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="expirynotify" NEXT="notifystudents"/>
107 <FIELD NAME="notifystudents" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="expirythreshold" NEXT="enrollable"/>
108 <FIELD NAME="enrollable" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" PREVIOUS="notifystudents" NEXT="enrolstartdate"/>
109 <FIELD NAME="enrolstartdate" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="enrollable" NEXT="enrolenddate"/>
110 <FIELD NAME="enrolenddate" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="enrolstartdate" NEXT="enrol"/>
111 <FIELD NAME="enrol" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" PREVIOUS="enrolenddate" NEXT="defaultrole"/>
112 <FIELD NAME="defaultrole" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="The default role given to participants who self-enrol" PREVIOUS="enrol" NEXT="enablecompletion"/>
0a127169 113 <FIELD NAME="enablecompletion" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="1 = allow use of 'completion' progress-tracking on this course. 0 = disable completion tracking on this course." PREVIOUS="defaultrole"/>
67d7d694 114 </FIELDS>
115 <KEYS>
52cb2e47 116 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
67d7d694 117 </KEYS>
118 <INDEXES>
119 <INDEX NAME="category" UNIQUE="false" FIELDS="category" NEXT="idnumber"/>
120 <INDEX NAME="idnumber" UNIQUE="false" FIELDS="idnumber" PREVIOUS="category" NEXT="shortname"/>
0a127169 121 <INDEX NAME="shortname" UNIQUE="false" FIELDS="shortname" PREVIOUS="idnumber"/>
67d7d694 122 </INDEXES>
123 </TABLE>
124 <TABLE NAME="course_categories" COMMENT="Course categories" PREVIOUS="course" NEXT="course_display">
125 <FIELDS>
74c288a1 126 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="name"/>
127 <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="id" NEXT="description"/>
8bdc9cac
SH
128 <FIELD NAME="description" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" PREVIOUS="name" NEXT="descriptionformat"/>
129 <FIELD NAME="descriptionformat" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="description" NEXT="parent"/>
130 <FIELD NAME="parent" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="descriptionformat" NEXT="sortorder"/>
74c288a1 131 <FIELD NAME="sortorder" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="parent" NEXT="coursecount"/>
132 <FIELD NAME="coursecount" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="sortorder" NEXT="visible"/>
133 <FIELD NAME="visible" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" DEFAULT="1" SEQUENCE="false" PREVIOUS="coursecount" NEXT="timemodified"/>
134 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="visible" NEXT="depth"/>
135 <FIELD NAME="depth" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="timemodified" NEXT="path"/>
136 <FIELD NAME="path" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="depth" NEXT="theme"/>
137 <FIELD NAME="theme" TYPE="char" LENGTH="50" NOTNULL="false" SEQUENCE="false" COMMENT="Theme for the category" PREVIOUS="path"/>
67d7d694 138 </FIELDS>
139 <KEYS>
28271c72 140 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="parent"/>
b08eda73 141 <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 142 </KEYS>
143 </TABLE>
144 <TABLE NAME="course_display" COMMENT="Stores info about how to display the course" PREVIOUS="course_categories" NEXT="course_meta">
145 <FIELDS>
74c288a1 146 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="course"/>
147 <FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="userid"/>
148 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="course" NEXT="display"/>
149 <FIELD NAME="display" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" PREVIOUS="userid"/>
67d7d694 150 </FIELDS>
151 <KEYS>
52cb2e47 152 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
67d7d694 153 </KEYS>
154 <INDEXES>
155 <INDEX NAME="course_userid" UNIQUE="false" FIELDS="course, userid"/>
156 </INDEXES>
157 </TABLE>
158 <TABLE NAME="course_meta" COMMENT="to store meta-courses relations" PREVIOUS="course_display" NEXT="course_modules">
159 <FIELDS>
74c288a1 160 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="parent_course"/>
161 <FIELD NAME="parent_course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="child_course"/>
162 <FIELD NAME="child_course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="parent_course"/>
67d7d694 163 </FIELDS>
164 <KEYS>
52cb2e47 165 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
67d7d694 166 </KEYS>
167 <INDEXES>
168 <INDEX NAME="parent_course" UNIQUE="false" FIELDS="parent_course" NEXT="child_course"/>
169 <INDEX NAME="child_course" UNIQUE="false" FIELDS="child_course" PREVIOUS="parent_course"/>
170 </INDEXES>
171 </TABLE>
0953a4e7 172 <TABLE NAME="course_modules" COMMENT="course_modules table retrofitted from MySQL" PREVIOUS="course_meta" NEXT="course_modules_availability">
67d7d694 173 <FIELDS>
74c288a1 174 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="course"/>
175 <FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="module"/>
176 <FIELD NAME="module" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="course" NEXT="instance"/>
177 <FIELD NAME="instance" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="module" NEXT="section"/>
178 <FIELD NAME="section" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="instance" NEXT="idnumber"/>
179 <FIELD NAME="idnumber" TYPE="char" LENGTH="100" NOTNULL="false" SEQUENCE="false" COMMENT="customizable idnumber" PREVIOUS="section" NEXT="added"/>
180 <FIELD NAME="added" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="idnumber" NEXT="score"/>
181 <FIELD NAME="score" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" PREVIOUS="added" NEXT="indent"/>
182 <FIELD NAME="indent" TYPE="int" LENGTH="5" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="score" NEXT="visible"/>
183 <FIELD NAME="visible" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" DEFAULT="1" SEQUENCE="false" PREVIOUS="indent" NEXT="visibleold"/>
184 <FIELD NAME="visibleold" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" DEFAULT="1" SEQUENCE="false" PREVIOUS="visible" NEXT="groupmode"/>
185 <FIELD NAME="groupmode" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" PREVIOUS="visibleold" NEXT="groupingid"/>
186 <FIELD NAME="groupingid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="groupmode" NEXT="groupmembersonly"/>
187 <FIELD NAME="groupmembersonly" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="only members of any group are allowed to access the activity" PREVIOUS="groupingid" NEXT="completion"/>
188 <FIELD NAME="completion" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Whether the completion-tracking facilities are enabled for this activity. 0 = not enabled (database default) 1 = manual tracking, user can tick this activity off (UI default for most activity types) 2 = automatic tracking, system should mark completion according to rules specified in course_moduleS_completion" PREVIOUS="groupmembersonly" NEXT="completiongradeitemnumber"/>
189 <FIELD NAME="completiongradeitemnumber" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="Grade-item number used to track automatic completion, if applicable." PREVIOUS="completion" NEXT="completionview"/>
190 <FIELD NAME="completionview" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Controls whether a page view is part of the automatic completion requirements for this activity. 0 = view not required 1 = view required" PREVIOUS="completiongradeitemnumber" NEXT="completionexpected"/>
191 <FIELD NAME="completionexpected" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Date at which students are expected to complete this activity. This field is used when displaying student progress." PREVIOUS="completionview" NEXT="availablefrom"/>
192 <FIELD NAME="availablefrom" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="If set non-zero, the activity only becomes available from the time given here." PREVIOUS="completionexpected" NEXT="availableuntil"/>
193 <FIELD NAME="availableuntil" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="If set non-zero, the activity is only available until the time given here." PREVIOUS="availablefrom" NEXT="showavailability"/>
194 <FIELD NAME="showavailability" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="If this field is set to 1 and the activity is not available because the 'availablefrom' date has not been reached, or one of the conditions in course_modules_availability is not matched, then the item will be displayed greyed-out (unclickable) with an information message such as 'Available from (date)'. Otherwise, the item will not be displayed to students at all." PREVIOUS="availableuntil"/>
67d7d694 195 </FIELDS>
196 <KEYS>
28271c72 197 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="groupingid"/>
2524b0f2 198 <KEY NAME="groupingid" TYPE="foreign" FIELDS="groupingid" REFTABLE="groupings" REFFIELDS="id" PREVIOUS="primary"/>
67d7d694 199 </KEYS>
200 <INDEXES>
201 <INDEX NAME="visible" UNIQUE="false" FIELDS="visible" NEXT="course"/>
202 <INDEX NAME="course" UNIQUE="false" FIELDS="course" PREVIOUS="visible" NEXT="module"/>
203 <INDEX NAME="module" UNIQUE="false" FIELDS="module" PREVIOUS="course" NEXT="instance"/>
4a039315 204 <INDEX NAME="instance" UNIQUE="false" FIELDS="instance" PREVIOUS="module" NEXT="idnumber-course"/>
205 <INDEX NAME="idnumber-course" UNIQUE="false" FIELDS="idnumber, course" COMMENT="non unique index (although programatically we are guarantying some sort of uniqueness both under this table and the grade_items one). TODO: We need a central store of module idnumbers in the future." PREVIOUS="instance"/>
67d7d694 206 </INDEXES>
207 </TABLE>
0953a4e7 208 <TABLE NAME="course_modules_availability" COMMENT="Table stores conditions that affect whether a module/activity is currently available to students or not." PREVIOUS="course_modules" NEXT="course_modules_completion">
209 <FIELDS>
74c288a1 210 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="coursemoduleid"/>
211 <FIELD NAME="coursemoduleid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="ID of the module whose availability is being restricted by this condition." PREVIOUS="id" NEXT="sourcecmid"/>
212 <FIELD NAME="sourcecmid" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="If this condition is based on completion of another activity, then this is the course-module ID of that activity. Otherwise null." PREVIOUS="coursemoduleid" NEXT="requiredcompletion"/>
213 <FIELD NAME="requiredcompletion" TYPE="int" LENGTH="1" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="If this condition is on a module's completion, then this should be set to the required completion state. Otherwise null. Suitable values are 1 = completed, 2 = completed-passed, 3 = completed-failed." PREVIOUS="sourcecmid" NEXT="gradeitemid"/>
214 <FIELD NAME="gradeitemid" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="If this condition is based on a gradebook score, the item ID is given here (and the item will now not be available until a value is achieved for that grade). Otherwise null." PREVIOUS="requiredcompletion" NEXT="grademin"/>
215 <FIELD NAME="grademin" TYPE="number" LENGTH="10" NOTNULL="false" UNSIGNED="false" SEQUENCE="false" DECIMALS="5" COMMENT="If set, this is the minimum grade percentage that must be reached (greater than or equal) in order for this module to appear. Otherwise null." PREVIOUS="gradeitemid" NEXT="grademax"/>
216 <FIELD NAME="grademax" TYPE="number" LENGTH="10" NOTNULL="false" UNSIGNED="false" SEQUENCE="false" DECIMALS="5" COMMENT="If set, this is the maximum grade percentage that users must be below (less than) in order to display this item. Otherwise null." PREVIOUS="grademin"/>
0953a4e7 217 </FIELDS>
218 <KEYS>
cbb17d54 219 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="coursemoduleid"/>
220 <KEY NAME="coursemoduleid" TYPE="foreign" FIELDS="coursemoduleid" REFTABLE="course_modules" REFFIELDS="id" PREVIOUS="primary" NEXT="sourcecmid"/>
221 <KEY NAME="sourcecmid" TYPE="foreign" FIELDS="sourcecmid" REFTABLE="course_modules" REFFIELDS="id" PREVIOUS="coursemoduleid" NEXT="gradeitemid"/>
222 <KEY NAME="gradeitemid" TYPE="foreign" FIELDS="gradeitemid" REFTABLE="grade_items" REFFIELDS="id" PREVIOUS="sourcecmid"/>
0953a4e7 223 </KEYS>
224 </TABLE>
225 <TABLE NAME="course_modules_completion" COMMENT="Stores the completion state (completed or not completed, etc) of each user on each activity." PREVIOUS="course_modules_availability" NEXT="course_sections">
4e781c7b 226 <FIELDS>
74c288a1 227 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="coursemoduleid"/>
228 <FIELD NAME="coursemoduleid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="Activity that has been completed (or not)." PREVIOUS="id" NEXT="userid"/>
229 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="ID of user who has (or hasn't) completed the activity." PREVIOUS="coursemoduleid" NEXT="completionstate"/>
230 <FIELD NAME="completionstate" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="Whether or not the user has completed the activity. Available states: 0 = not completed [if there's no row in this table, that also counts as 0] 1 = completed 2 = completed, show passed 3 = completed, show failed" PREVIOUS="userid" NEXT="viewed"/>
231 <FIELD NAME="viewed" TYPE="int" LENGTH="1" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="Tracks whether or not this activity has been viewed. NULL = we are not tracking viewed for this activity 0 = not viewed 1 = viewed" PREVIOUS="completionstate" NEXT="timemodified"/>
232 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="Time at which the completion state last changed." PREVIOUS="viewed"/>
4e781c7b 233 </FIELDS>
234 <KEYS>
235 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
236 </KEYS>
237 <INDEXES>
238 <INDEX NAME="coursemoduleid" UNIQUE="false" FIELDS="coursemoduleid" COMMENT="For quick access via course-module (e.g. when displaying course module settings page and we need to determine whether anyone has completed it)." NEXT="userid"/>
239 <INDEX NAME="userid" UNIQUE="false" FIELDS="userid" COMMENT="Index on user ID. Used when obtaining completion information for normal course page view." PREVIOUS="coursemoduleid"/>
4e781c7b 240 </INDEXES>
241 </TABLE>
242 <TABLE NAME="course_sections" COMMENT="to define the sections for each course" PREVIOUS="course_modules_completion" NEXT="course_request">
67d7d694 243 <FIELDS>
74c288a1 244 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="course"/>
245 <FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="section"/>
0f4ab67d
SH
246 <FIELD NAME="section" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="course" NEXT="name"/>
247 <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" PREVIOUS="section" NEXT="summary"/>
248 <FIELD NAME="summary" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" PREVIOUS="name" NEXT="sequence"/>
74c288a1 249 <FIELD NAME="sequence" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" PREVIOUS="summary" NEXT="visible"/>
250 <FIELD NAME="visible" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" DEFAULT="1" SEQUENCE="false" PREVIOUS="sequence"/>
67d7d694 251 </FIELDS>
252 <KEYS>
52cb2e47 253 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
67d7d694 254 </KEYS>
255 <INDEXES>
256 <INDEX NAME="course_section" UNIQUE="false" FIELDS="course, section"/>
257 </INDEXES>
258 </TABLE>
259 <TABLE NAME="course_request" COMMENT="course requests" PREVIOUS="course_sections" NEXT="course_allowed_modules">
260 <FIELDS>
74c288a1 261 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="fullname"/>
262 <FIELD NAME="fullname" TYPE="char" LENGTH="254" NOTNULL="true" SEQUENCE="false" PREVIOUS="id" NEXT="shortname"/>
263 <FIELD NAME="shortname" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" PREVIOUS="fullname" NEXT="summary"/>
8bdc9cac
SH
264 <FIELD NAME="summary" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" PREVIOUS="shortname" NEXT="summaryformat"/>
265 <FIELD NAME="summaryformat" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="summary" NEXT="reason"/>
266 <FIELD NAME="reason" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" PREVIOUS="summaryformat" NEXT="requester"/>
74c288a1 267 <FIELD NAME="requester" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="reason" NEXT="password"/>
268 <FIELD NAME="password" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" PREVIOUS="requester"/>
67d7d694 269 </FIELDS>
270 <KEYS>
52cb2e47 271 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
67d7d694 272 </KEYS>
273 <INDEXES>
274 <INDEX NAME="shortname" UNIQUE="false" FIELDS="shortname"/>
275 </INDEXES>
276 </TABLE>
0fc9c009 277 <TABLE NAME="course_allowed_modules" COMMENT="allowed modules foreach course" PREVIOUS="course_request" NEXT="filter_active">
67d7d694 278 <FIELDS>
74c288a1 279 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="course"/>
280 <FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="module"/>
281 <FIELD NAME="module" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="course"/>
67d7d694 282 </FIELDS>
283 <KEYS>
52cb2e47 284 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
67d7d694 285 </KEYS>
286 <INDEXES>
287 <INDEX NAME="course" UNIQUE="false" FIELDS="course" NEXT="module"/>
288 <INDEX NAME="module" UNIQUE="false" FIELDS="module" PREVIOUS="course"/>
289 </INDEXES>
290 </TABLE>
0fc9c009 291 <TABLE NAME="filter_active" COMMENT="Stores information about which filters are active in which contexts. Also the filter sort order. See get_active_filters in lib/filterlib.php for how this data is used." PREVIOUS="course_allowed_modules" NEXT="filter_config">
292 <FIELDS>
74c288a1 293 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="filter"/>
294 <FIELD NAME="filter" TYPE="char" LENGTH="32" NOTNULL="true" SEQUENCE="false" COMMENT="The filter internal name, like 'filter/tex' or 'mod/glossary'." PREVIOUS="id" NEXT="contextid"/>
295 <FIELD NAME="contextid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="References context.id." PREVIOUS="filter" NEXT="active"/>
296 <FIELD NAME="active" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="false" SEQUENCE="false" COMMENT="Whether this filter is active in this context. +1 = On, -1 = Off, no row with this contextid = inherit. As a special case, when contextid points to the system context, -9999 means this filter is completely disabled." PREVIOUS="contextid" NEXT="sortorder"/>
297 <FIELD NAME="sortorder" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" COMMENT="Only relevant if contextid points to the system context. In other cases this field should contain 0. The order in which the filters should be applied." PREVIOUS="active"/>
0fc9c009 298 </FIELDS>
299 <KEYS>
300 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="contextid"/>
301 <KEY NAME="contextid" TYPE="foreign" FIELDS="contextid" REFTABLE="context" REFFIELDS="id" PREVIOUS="primary"/>
302 </KEYS>
303 <INDEXES>
304 <INDEX NAME="contextid-filter" UNIQUE="true" FIELDS="contextid, filter"/>
305 </INDEXES>
306 </TABLE>
307 <TABLE NAME="filter_config" COMMENT="Stores per-context configuration settings for filters which have them." PREVIOUS="filter_active" NEXT="event">
308 <FIELDS>
74c288a1 309 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="filter"/>
310 <FIELD NAME="filter" TYPE="char" LENGTH="32" NOTNULL="true" SEQUENCE="false" COMMENT="The filter internal name, like 'filter/tex' or 'mod/glossary'." PREVIOUS="id" NEXT="contextid"/>
311 <FIELD NAME="contextid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="References context.id." PREVIOUS="filter" NEXT="name"/>
312 <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="The config variable name." PREVIOUS="contextid" NEXT="value"/>
313 <FIELD NAME="value" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" COMMENT="The correspoding config variable value." PREVIOUS="name"/>
0fc9c009 314 </FIELDS>
315 <KEYS>
316 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="contextid"/>
317 <KEY NAME="contextid" TYPE="foreign" FIELDS="contextid" REFTABLE="context" REFFIELDS="id" PREVIOUS="primary"/>
318 </KEYS>
319 <INDEXES>
320 <INDEX NAME="contextid-filter-name" UNIQUE="true" FIELDS="contextid, filter, name" COMMENT="In each context, at most one value per name per filter."/>
321 </INDEXES>
322 </TABLE>
323 <TABLE NAME="event" COMMENT="For everything with a time associated to it" PREVIOUS="filter_config" NEXT="cache_filters">
67d7d694 324 <FIELDS>
74c288a1 325 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="name"/>
326 <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="id" NEXT="description"/>
327 <FIELD NAME="description" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" PREVIOUS="name" NEXT="format"/>
328 <FIELD NAME="format" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="description" NEXT="courseid"/>
329 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="format" NEXT="groupid"/>
330 <FIELD NAME="groupid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="courseid" NEXT="userid"/>
331 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="groupid" NEXT="repeatid"/>
332 <FIELD NAME="repeatid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="userid" NEXT="modulename"/>
333 <FIELD NAME="modulename" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" PREVIOUS="repeatid" NEXT="instance"/>
334 <FIELD NAME="instance" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="modulename" NEXT="eventtype"/>
335 <FIELD NAME="eventtype" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" PREVIOUS="instance" NEXT="timestart"/>
336 <FIELD NAME="timestart" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="eventtype" NEXT="timeduration"/>
337 <FIELD NAME="timeduration" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="timestart" NEXT="visible"/>
338 <FIELD NAME="visible" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="false" DEFAULT="1" SEQUENCE="false" PREVIOUS="timeduration" NEXT="uuid"/>
339 <FIELD NAME="uuid" TYPE="char" LENGTH="36" NOTNULL="true" SEQUENCE="false" PREVIOUS="visible" NEXT="sequence"/>
340 <FIELD NAME="sequence" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" PREVIOUS="uuid" NEXT="timemodified"/>
341 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="sequence"/>
67d7d694 342 </FIELDS>
343 <KEYS>
52cb2e47 344 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
67d7d694 345 </KEYS>
346 <INDEXES>
347 <INDEX NAME="courseid" UNIQUE="false" FIELDS="courseid" NEXT="userid"/>
348 <INDEX NAME="userid" UNIQUE="false" FIELDS="userid" PREVIOUS="courseid" NEXT="timestart"/>
349 <INDEX NAME="timestart" UNIQUE="false" FIELDS="timestart" PREVIOUS="userid" NEXT="timeduration"/>
e06d74d5 350 <INDEX NAME="timeduration" UNIQUE="false" FIELDS="timeduration" PREVIOUS="timestart" NEXT="groupid-courseid-visible-userid"/>
351 <INDEX NAME="groupid-courseid-visible-userid" UNIQUE="false" FIELDS="groupid, courseid, visible, userid" COMMENT="used for calendar view" PREVIOUS="timeduration"/>
67d7d694 352 </INDEXES>
353 </TABLE>
354 <TABLE NAME="cache_filters" COMMENT="For keeping information about cached data" PREVIOUS="event" NEXT="cache_text">
355 <FIELDS>
74c288a1 356 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="filter"/>
357 <FIELD NAME="filter" TYPE="char" LENGTH="32" NOTNULL="true" SEQUENCE="false" PREVIOUS="id" NEXT="version"/>
358 <FIELD NAME="version" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="filter" NEXT="md5key"/>
359 <FIELD NAME="md5key" TYPE="char" LENGTH="32" NOTNULL="true" SEQUENCE="false" PREVIOUS="version" NEXT="rawtext"/>
360 <FIELD NAME="rawtext" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" PREVIOUS="md5key" NEXT="timemodified"/>
361 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="rawtext"/>
67d7d694 362 </FIELDS>
363 <KEYS>
52cb2e47 364 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
67d7d694 365 </KEYS>
366 <INDEXES>
367 <INDEX NAME="filter_md5key" UNIQUE="false" FIELDS="filter, md5key"/>
368 </INDEXES>
369 </TABLE>
eeccaea1 370 <TABLE NAME="cache_text" COMMENT="For storing temporary copies of processed texts" PREVIOUS="cache_filters" NEXT="log">
67d7d694 371 <FIELDS>
74c288a1 372 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="md5key"/>
373 <FIELD NAME="md5key" TYPE="char" LENGTH="32" NOTNULL="true" SEQUENCE="false" PREVIOUS="id" NEXT="formattedtext"/>
374 <FIELD NAME="formattedtext" TYPE="text" LENGTH="big" NOTNULL="true" SEQUENCE="false" PREVIOUS="md5key" NEXT="timemodified"/>
375 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="formattedtext"/>
67d7d694 376 </FIELDS>
377 <KEYS>
52cb2e47 378 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
67d7d694 379 </KEYS>
380 <INDEXES>
cef1ea8e 381 <INDEX NAME="md5key" UNIQUE="false" FIELDS="md5key" NEXT="timemodified"/>
382 <INDEX NAME="timemodified" UNIQUE="false" FIELDS="timemodified" COMMENT="Mainly to help deletion of expired records from cron" PREVIOUS="md5key"/>
67d7d694 383 </INDEXES>
384 </TABLE>
b4154c2d 385 <TABLE NAME="log" COMMENT="Every action is logged as far as possible" PREVIOUS="cache_text" NEXT="log_queries">
67d7d694 386 <FIELDS>
74c288a1 387 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="time"/>
388 <FIELD NAME="time" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="userid"/>
389 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="time" NEXT="ip"/>
390 <FIELD NAME="ip" TYPE="char" LENGTH="45" NOTNULL="true" SEQUENCE="false" PREVIOUS="userid" NEXT="course"/>
391 <FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="ip" NEXT="module"/>
392 <FIELD NAME="module" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" PREVIOUS="course" NEXT="cmid"/>
393 <FIELD NAME="cmid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="module" NEXT="action"/>
394 <FIELD NAME="action" TYPE="char" LENGTH="40" NOTNULL="true" SEQUENCE="false" PREVIOUS="cmid" NEXT="url"/>
395 <FIELD NAME="url" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" PREVIOUS="action" NEXT="info"/>
396 <FIELD NAME="info" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="url"/>
67d7d694 397 </FIELDS>
398 <KEYS>
52cb2e47 399 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
67d7d694 400 </KEYS>
401 <INDEXES>
b7943731 402 <INDEX NAME="course-module-action" UNIQUE="false" FIELDS="course, module, action" NEXT="time"/>
403 <INDEX NAME="time" UNIQUE="false" FIELDS="time" PREVIOUS="course-module-action" NEXT="action"/>
404 <INDEX NAME="action" UNIQUE="false" FIELDS="action" PREVIOUS="time" NEXT="userid-course"/>
da4aa3e4 405 <INDEX NAME="userid-course" UNIQUE="false" FIELDS="userid, course" PREVIOUS="action" NEXT="cmid"/>
406 <INDEX NAME="cmid" UNIQUE="false" FIELDS="cmid" PREVIOUS="userid-course"/>
67d7d694 407 </INDEXES>
408 </TABLE>
b4154c2d 409 <TABLE NAME="log_queries" COMMENT="Logged database queries." PREVIOUS="log" NEXT="log_display">
410 <FIELDS>
411 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="qtype"/>
412 <FIELD NAME="qtype" TYPE="int" LENGTH="5" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="query type constant" PREVIOUS="id" NEXT="sqltext"/>
413 <FIELD NAME="sqltext" TYPE="text" LENGTH="medium" NOTNULL="true" SEQUENCE="false" COMMENT="query sql" PREVIOUS="qtype" NEXT="sqlparams"/>
414 <FIELD NAME="sqlparams" TYPE="text" LENGTH="big" NOTNULL="false" SEQUENCE="false" COMMENT="query parameters" PREVIOUS="sqltext" NEXT="error"/>
415 <FIELD NAME="error" TYPE="int" LENGTH="5" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="is error" PREVIOUS="sqlparams" NEXT="info"/>
416 <FIELD NAME="info" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" COMMENT="detailed info such as error text" PREVIOUS="error" NEXT="backtrace"/>
417 <FIELD NAME="backtrace" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" COMMENT="php execution trace" PREVIOUS="info" NEXT="exectime"/>
418 <FIELD NAME="exectime" TYPE="number" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="false" DECIMALS="5" COMMENT="query execution time in seconds as float" PREVIOUS="backtrace" NEXT="timelogged"/>
419 <FIELD NAME="timelogged" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="timestamp when log info stored into db" PREVIOUS="exectime"/>
420 </FIELDS>
421 <KEYS>
422 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
423 </KEYS>
424 </TABLE>
425 <TABLE NAME="log_display" COMMENT="For a particular module/action, specifies a moodle table/field" PREVIOUS="log_queries" NEXT="message">
67d7d694 426 <FIELDS>
74c288a1 427 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="module"/>
428 <FIELD NAME="module" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" PREVIOUS="id" NEXT="action"/>
429 <FIELD NAME="action" TYPE="char" LENGTH="40" NOTNULL="true" SEQUENCE="false" PREVIOUS="module" NEXT="mtable"/>
430 <FIELD NAME="mtable" TYPE="char" LENGTH="30" NOTNULL="true" SEQUENCE="false" PREVIOUS="action" NEXT="field"/>
431 <FIELD NAME="field" TYPE="char" LENGTH="200" NOTNULL="true" SEQUENCE="false" PREVIOUS="mtable"/>
67d7d694 432 </FIELDS>
433 <KEYS>
52cb2e47 434 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
67d7d694 435 </KEYS>
436 <INDEXES>
437 <INDEX NAME="module-action" UNIQUE="true" FIELDS="module, action"/>
438 </INDEXES>
439 </TABLE>
5ac9b67c 440 <TABLE NAME="message" COMMENT="Stores all unread messages" PREVIOUS="log_display" NEXT="message_read">
67d7d694 441 <FIELDS>
74c288a1 442 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="useridfrom"/>
443 <FIELD NAME="useridfrom" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="useridto"/>
444 <FIELD NAME="useridto" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" PREVIOUS="useridfrom" NEXT="subject"/>
445 <FIELD NAME="subject" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" COMMENT="The message subject" PREVIOUS="useridto" NEXT="fullmessage"/>
446 <FIELD NAME="fullmessage" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" PREVIOUS="subject" NEXT="fullmessageformat"/>
447 <FIELD NAME="fullmessageformat" TYPE="int" LENGTH="4" NOTNULL="false" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="The format of the full message" PREVIOUS="fullmessage" NEXT="fullmessagehtml"/>
448 <FIELD NAME="fullmessagehtml" TYPE="text" LENGTH="medium" NOTNULL="false" SEQUENCE="false" COMMENT="html format of message" PREVIOUS="fullmessageformat" NEXT="smallmessage"/>
449 <FIELD NAME="smallmessage" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" COMMENT="Smal version of message (eg sms)" PREVIOUS="fullmessagehtml" NEXT="timecreated"/>
450 <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" PREVIOUS="smallmessage"/>
67d7d694 451 </FIELDS>
452 <KEYS>
52cb2e47 453 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
67d7d694 454 </KEYS>
455 <INDEXES>
456 <INDEX NAME="useridfrom" UNIQUE="false" FIELDS="useridfrom" NEXT="useridto"/>
457 <INDEX NAME="useridto" UNIQUE="false" FIELDS="useridto" PREVIOUS="useridfrom"/>
458 </INDEXES>
459 </TABLE>
460 <TABLE NAME="message_read" COMMENT="Stores all messages that have been read" PREVIOUS="message" NEXT="message_contacts">
461 <FIELDS>
74c288a1 462 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="useridfrom"/>
463 <FIELD NAME="useridfrom" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="useridto"/>
464 <FIELD NAME="useridto" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" PREVIOUS="useridfrom" NEXT="subject"/>
465 <FIELD NAME="subject" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" COMMENT="The message subject" PREVIOUS="useridto" NEXT="fullmessage"/>
466 <FIELD NAME="fullmessage" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" PREVIOUS="subject" NEXT="fullmessageformat"/>
467 <FIELD NAME="fullmessageformat" TYPE="int" LENGTH="4" NOTNULL="false" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="The format of the full message" PREVIOUS="fullmessage" NEXT="fullmessagehtml"/>
468 <FIELD NAME="fullmessagehtml" TYPE="text" LENGTH="medium" NOTNULL="false" SEQUENCE="false" COMMENT="html format of message" PREVIOUS="fullmessageformat" NEXT="smallmessage"/>
469 <FIELD NAME="smallmessage" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" COMMENT="Smal version of message (eg sms)" PREVIOUS="fullmessagehtml" NEXT="timecreated"/>
470 <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" PREVIOUS="smallmessage" NEXT="timeread"/>
471 <FIELD NAME="timeread" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" PREVIOUS="timecreated"/>
67d7d694 472 </FIELDS>
473 <KEYS>
52cb2e47 474 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
67d7d694 475 </KEYS>
476 <INDEXES>
477 <INDEX NAME="useridfrom" UNIQUE="false" FIELDS="useridfrom" NEXT="useridto"/>
478 <INDEX NAME="useridto" UNIQUE="false" FIELDS="useridto" PREVIOUS="useridfrom"/>
479 </INDEXES>
480 </TABLE>
481 <TABLE NAME="message_contacts" COMMENT="Maintains lists of relationships between users" PREVIOUS="message_read" NEXT="modules">
482 <FIELDS>
74c288a1 483 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="userid"/>
484 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="contactid"/>
485 <FIELD NAME="contactid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="userid" NEXT="blocked"/>
486 <FIELD NAME="blocked" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="contactid"/>
67d7d694 487 </FIELDS>
488 <KEYS>
52cb2e47 489 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
67d7d694 490 </KEYS>
491 <INDEXES>
492 <INDEX NAME="userid-contactid" UNIQUE="true" FIELDS="userid, contactid"/>
493 </INDEXES>
494 </TABLE>
81f2bb81 495 <TABLE NAME="modules" COMMENT="modules available in the site" PREVIOUS="message_contacts" NEXT="sessions">
67d7d694 496 <FIELDS>
74c288a1 497 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="name"/>
498 <FIELD NAME="name" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" PREVIOUS="id" NEXT="version"/>
499 <FIELD NAME="version" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" PREVIOUS="name" NEXT="cron"/>
500 <FIELD NAME="cron" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="version" NEXT="lastcron"/>
501 <FIELD NAME="lastcron" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="cron" NEXT="search"/>
502 <FIELD NAME="search" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="lastcron" NEXT="visible"/>
503 <FIELD NAME="visible" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" DEFAULT="1" SEQUENCE="false" PREVIOUS="search"/>
67d7d694 504 </FIELDS>
505 <KEYS>
52cb2e47 506 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
67d7d694 507 </KEYS>
508 <INDEXES>
509 <INDEX NAME="name" UNIQUE="false" FIELDS="name"/>
510 </INDEXES>
511 </TABLE>
81f2bb81 512 <TABLE NAME="sessions" COMMENT="Database based session storage - now recommended" PREVIOUS="modules" NEXT="timezone">
67d7d694 513 <FIELDS>
74c288a1 514 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="state"/>
515 <FIELD NAME="state" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="0 means normal session" PREVIOUS="id" NEXT="sid"/>
516 <FIELD NAME="sid" TYPE="char" LENGTH="128" NOTNULL="true" SEQUENCE="false" COMMENT="Session id" PREVIOUS="state" NEXT="userid"/>
517 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="sid" NEXT="sessdata"/>
518 <FIELD NAME="sessdata" TYPE="text" LENGTH="big" NOTNULL="false" SEQUENCE="false" COMMENT="session content" PREVIOUS="userid" NEXT="timecreated"/>
519 <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="sessdata" NEXT="timemodified"/>
520 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="timecreated" NEXT="firstip"/>
521 <FIELD NAME="firstip" TYPE="char" LENGTH="45" NOTNULL="false" SEQUENCE="false" PREVIOUS="timemodified" NEXT="lastip"/>
522 <FIELD NAME="lastip" TYPE="char" LENGTH="45" NOTNULL="false" SEQUENCE="false" PREVIOUS="firstip"/>
67d7d694 523 </FIELDS>
524 <KEYS>
81f2bb81 525 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="userid"/>
526 <KEY NAME="userid" TYPE="foreign" FIELDS="userid" REFTABLE="user" REFFIELDS="id" PREVIOUS="primary"/>
67d7d694 527 </KEYS>
528 <INDEXES>
656be893 529 <INDEX NAME="state" UNIQUE="false" FIELDS="state" NEXT="sid"/>
530 <INDEX NAME="sid" UNIQUE="true" FIELDS="sid" PREVIOUS="state" NEXT="timecreated"/>
81f2bb81 531 <INDEX NAME="timecreated" UNIQUE="false" FIELDS="timecreated" PREVIOUS="sid" NEXT="timemodified"/>
532 <INDEX NAME="timemodified" UNIQUE="false" FIELDS="timemodified" PREVIOUS="timecreated"/>
67d7d694 533 </INDEXES>
534 </TABLE>
81f2bb81 535 <TABLE NAME="timezone" COMMENT="Rules for calculating local wall clock time for users" PREVIOUS="sessions" NEXT="user">
67d7d694 536 <FIELDS>
74c288a1 537 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="name"/>
538 <FIELD NAME="name" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" PREVIOUS="id" NEXT="year"/>
539 <FIELD NAME="year" TYPE="int" LENGTH="11" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" PREVIOUS="name" NEXT="tzrule"/>
540 <FIELD NAME="tzrule" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" PREVIOUS="year" NEXT="gmtoff"/>
541 <FIELD NAME="gmtoff" TYPE="int" LENGTH="11" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" PREVIOUS="tzrule" NEXT="dstoff"/>
542 <FIELD NAME="dstoff" TYPE="int" LENGTH="11" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" PREVIOUS="gmtoff" NEXT="dst_month"/>
543 <FIELD NAME="dst_month" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" PREVIOUS="dstoff" NEXT="dst_startday"/>
544 <FIELD NAME="dst_startday" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" PREVIOUS="dst_month" NEXT="dst_weekday"/>
545 <FIELD NAME="dst_weekday" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" PREVIOUS="dst_startday" NEXT="dst_skipweeks"/>
546 <FIELD NAME="dst_skipweeks" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" PREVIOUS="dst_weekday" NEXT="dst_time"/>
547 <FIELD NAME="dst_time" TYPE="char" LENGTH="6" NOTNULL="true" DEFAULT="00:00" SEQUENCE="false" PREVIOUS="dst_skipweeks" NEXT="std_month"/>
548 <FIELD NAME="std_month" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" PREVIOUS="dst_time" NEXT="std_startday"/>
549 <FIELD NAME="std_startday" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" PREVIOUS="std_month" NEXT="std_weekday"/>
550 <FIELD NAME="std_weekday" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" PREVIOUS="std_startday" NEXT="std_skipweeks"/>
551 <FIELD NAME="std_skipweeks" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" PREVIOUS="std_weekday" NEXT="std_time"/>
552 <FIELD NAME="std_time" TYPE="char" LENGTH="6" NOTNULL="true" DEFAULT="00:00" SEQUENCE="false" PREVIOUS="std_skipweeks"/>
67d7d694 553 </FIELDS>
554 <KEYS>
52cb2e47 555 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
67d7d694 556 </KEYS>
557 </TABLE>
04338f9e 558 <TABLE NAME="user" COMMENT="One record for each person" PREVIOUS="timezone" NEXT="user_preferences">
67d7d694 559 <FIELDS>
74c288a1 560 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="auth"/>
561 <FIELD NAME="auth" TYPE="char" LENGTH="20" NOTNULL="true" DEFAULT="manual" SEQUENCE="false" PREVIOUS="id" NEXT="confirmed"/>
562 <FIELD NAME="confirmed" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" PREVIOUS="auth" NEXT="policyagreed"/>
563 <FIELD NAME="policyagreed" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" PREVIOUS="confirmed" NEXT="deleted"/>
564 <FIELD NAME="deleted" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" PREVIOUS="policyagreed" NEXT="mnethostid"/>
565 <FIELD NAME="mnethostid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="deleted" NEXT="username"/>
566 <FIELD NAME="username" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" PREVIOUS="mnethostid" NEXT="password"/>
567 <FIELD NAME="password" TYPE="char" LENGTH="32" NOTNULL="true" SEQUENCE="false" PREVIOUS="username" NEXT="idnumber"/>
568 <FIELD NAME="idnumber" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="password" NEXT="firstname"/>
569 <FIELD NAME="firstname" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" PREVIOUS="idnumber" NEXT="lastname"/>
570 <FIELD NAME="lastname" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" PREVIOUS="firstname" NEXT="email"/>
571 <FIELD NAME="email" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" PREVIOUS="lastname" NEXT="emailstop"/>
572 <FIELD NAME="emailstop" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="email" NEXT="icq"/>
573 <FIELD NAME="icq" TYPE="char" LENGTH="15" NOTNULL="true" SEQUENCE="false" PREVIOUS="emailstop" NEXT="skype"/>
574 <FIELD NAME="skype" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" PREVIOUS="icq" NEXT="yahoo"/>
575 <FIELD NAME="yahoo" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" PREVIOUS="skype" NEXT="aim"/>
576 <FIELD NAME="aim" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" PREVIOUS="yahoo" NEXT="msn"/>
577 <FIELD NAME="msn" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" PREVIOUS="aim" NEXT="phone1"/>
578 <FIELD NAME="phone1" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" PREVIOUS="msn" NEXT="phone2"/>
579 <FIELD NAME="phone2" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" PREVIOUS="phone1" NEXT="institution"/>
580 <FIELD NAME="institution" TYPE="char" LENGTH="40" NOTNULL="true" SEQUENCE="false" PREVIOUS="phone2" NEXT="department"/>
581 <FIELD NAME="department" TYPE="char" LENGTH="30" NOTNULL="true" SEQUENCE="false" PREVIOUS="institution" NEXT="address"/>
582 <FIELD NAME="address" TYPE="char" LENGTH="70" NOTNULL="true" SEQUENCE="false" PREVIOUS="department" NEXT="city"/>
583 <FIELD NAME="city" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" PREVIOUS="address" NEXT="country"/>
584 <FIELD NAME="country" TYPE="char" LENGTH="2" NOTNULL="true" SEQUENCE="false" PREVIOUS="city" NEXT="lang"/>
3a915b06 585 <FIELD NAME="lang" TYPE="char" LENGTH="30" NOTNULL="true" DEFAULT="en" SEQUENCE="false" PREVIOUS="country" NEXT="theme"/>
74c288a1 586 <FIELD NAME="theme" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" PREVIOUS="lang" NEXT="timezone"/>
587 <FIELD NAME="timezone" TYPE="char" LENGTH="100" NOTNULL="true" DEFAULT="99" SEQUENCE="false" PREVIOUS="theme" NEXT="firstaccess"/>
588 <FIELD NAME="firstaccess" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="timezone" NEXT="lastaccess"/>
589 <FIELD NAME="lastaccess" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="firstaccess" NEXT="lastlogin"/>
590 <FIELD NAME="lastlogin" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="lastaccess" NEXT="currentlogin"/>
591 <FIELD NAME="currentlogin" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="lastlogin" NEXT="lastip"/>
592 <FIELD NAME="lastip" TYPE="char" LENGTH="45" NOTNULL="true" SEQUENCE="false" PREVIOUS="currentlogin" NEXT="secret"/>
593 <FIELD NAME="secret" TYPE="char" LENGTH="15" NOTNULL="true" SEQUENCE="false" PREVIOUS="lastip" NEXT="picture"/>
594 <FIELD NAME="picture" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" PREVIOUS="secret" NEXT="url"/>
595 <FIELD NAME="url" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="picture" NEXT="description"/>
8bdc9cac
SH
596 <FIELD NAME="description" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" PREVIOUS="url" NEXT="descriptionformat"/>
597 <FIELD NAME="descriptionformat" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="description" NEXT="mailformat"/>
598 <FIELD NAME="mailformat" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" PREVIOUS="descriptionformat" NEXT="maildigest"/>
74c288a1 599 <FIELD NAME="maildigest" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="mailformat" NEXT="maildisplay"/>
600 <FIELD NAME="maildisplay" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="2" SEQUENCE="false" PREVIOUS="maildigest" NEXT="htmleditor"/>
601 <FIELD NAME="htmleditor" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" PREVIOUS="maildisplay" NEXT="ajax"/>
602 <FIELD NAME="ajax" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" PREVIOUS="htmleditor" NEXT="autosubscribe"/>
603 <FIELD NAME="autosubscribe" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" PREVIOUS="ajax" NEXT="trackforums"/>
d3d393ab
RW
604 <FIELD NAME="trackforums" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="autosubscribe" NEXT="timecreated"/>
605 <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="trackforums" NEXT="timemodified"/>
606 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="timecreated" NEXT="trustbitmask"/>
74c288a1 607 <FIELD NAME="trustbitmask" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="timemodified" NEXT="imagealt"/>
608 <FIELD NAME="imagealt" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" COMMENT="alt tag for user uploaded image" PREVIOUS="trustbitmask" NEXT="screenreader"/>
609 <FIELD NAME="screenreader" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" COMMENT="flag for determining whehter the user uses a screenreader." PREVIOUS="imagealt"/>
67d7d694 610 </FIELDS>
611 <KEYS>
52cb2e47 612 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
67d7d694 613 </KEYS>
614 <INDEXES>
9654f633 615 <INDEX NAME="username" UNIQUE="true" FIELDS="mnethostid, username" NEXT="deleted"/>
67d7d694 616 <INDEX NAME="deleted" UNIQUE="false" FIELDS="deleted" PREVIOUS="username" NEXT="confirmed"/>
617 <INDEX NAME="confirmed" UNIQUE="false" FIELDS="confirmed" PREVIOUS="deleted" NEXT="firstname"/>
618 <INDEX NAME="firstname" UNIQUE="false" FIELDS="firstname" PREVIOUS="confirmed" NEXT="lastname"/>
619 <INDEX NAME="lastname" UNIQUE="false" FIELDS="lastname" PREVIOUS="firstname" NEXT="city"/>
620 <INDEX NAME="city" UNIQUE="false" FIELDS="city" PREVIOUS="lastname" NEXT="country"/>
621 <INDEX NAME="country" UNIQUE="false" FIELDS="country" PREVIOUS="city" NEXT="lastaccess"/>
622 <INDEX NAME="lastaccess" UNIQUE="false" FIELDS="lastaccess" PREVIOUS="country" NEXT="email"/>
623 <INDEX NAME="email" UNIQUE="false" FIELDS="email" PREVIOUS="lastaccess" NEXT="auth"/>
624 <INDEX NAME="auth" UNIQUE="false" FIELDS="auth" PREVIOUS="email" NEXT="idnumber"/>
625 <INDEX NAME="idnumber" UNIQUE="false" FIELDS="idnumber" PREVIOUS="auth"/>
626 </INDEXES>
627 </TABLE>
04338f9e 628 <TABLE NAME="user_preferences" COMMENT="Allows modules to store arbitrary user preferences" PREVIOUS="user" NEXT="user_lastaccess">
67d7d694 629 <FIELDS>
74c288a1 630 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="userid"/>
631 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="name"/>
632 <FIELD NAME="name" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" PREVIOUS="userid" NEXT="value"/>
633 <FIELD NAME="value" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="name"/>
67d7d694 634 </FIELDS>
635 <KEYS>
52cb2e47 636 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
67d7d694 637 </KEYS>
638 <INDEXES>
639 <INDEX NAME="userid-name" UNIQUE="true" FIELDS="userid, name"/>
640 </INDEXES>
641 </TABLE>
d3f31bf2 642 <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="scale">
8b9b5109 643 <FIELDS>
74c288a1 644 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="userid"/>
645 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="courseid"/>
646 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="userid" NEXT="timeaccess"/>
647 <FIELD NAME="timeaccess" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="courseid"/>
8b9b5109 648 </FIELDS>
649 <KEYS>
52cb2e47 650 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
8b9b5109 651 </KEYS>
652 <INDEXES>
653 <INDEX NAME="userid-courseid" UNIQUE="true" FIELDS="userid, courseid" NEXT="userid"/>
654 <INDEX NAME="userid" UNIQUE="false" FIELDS="userid" PREVIOUS="userid-courseid" NEXT="courseid"/>
655 <INDEX NAME="courseid" UNIQUE="false" FIELDS="courseid" PREVIOUS="userid"/>
656 </INDEXES>
657 </TABLE>
d3f31bf2 658 <TABLE NAME="scale" COMMENT="Defines grading scales" PREVIOUS="user_lastaccess" NEXT="scale_history">
659 <FIELDS>
74c288a1 660 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="courseid"/>
661 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="userid"/>
662 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="courseid" NEXT="name"/>
663 <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="userid" NEXT="scale"/>
664 <FIELD NAME="scale" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" PREVIOUS="name" NEXT="description"/>
8bdc9cac
SH
665 <FIELD NAME="description" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" PREVIOUS="scale" NEXT="descriptionformat"/>
666 <FIELD NAME="descriptionformat" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="description" NEXT="timemodified"/>
667 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="descriptionformat"/>
d3f31bf2 668 </FIELDS>
669 <KEYS>
52cb2e47 670 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
d3f31bf2 671 </KEYS>
672 <INDEXES>
673 <INDEX NAME="courseid" UNIQUE="false" FIELDS="courseid"/>
674 </INDEXES>
675 </TABLE>
676 <TABLE NAME="scale_history" COMMENT="History table" PREVIOUS="scale" NEXT="stats_daily">
677 <FIELDS>
74c288a1 678 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="action"/>
679 <FIELD NAME="action" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="created/modified/deleted constants" PREVIOUS="id" NEXT="oldid"/>
680 <FIELD NAME="oldid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="action" NEXT="source"/>
681 <FIELD NAME="source" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" COMMENT="What caused the modification? manual/module/import/..." PREVIOUS="oldid" NEXT="timemodified"/>
682 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="The last time this grade_item was modified" PREVIOUS="source" NEXT="loggeduser"/>
683 <FIELD NAME="loggeduser" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="the userid of the person who last modified this outcome" PREVIOUS="timemodified" NEXT="courseid"/>
684 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="loggeduser" NEXT="userid"/>
685 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="courseid" NEXT="name"/>
686 <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="userid" NEXT="scale"/>
687 <FIELD NAME="scale" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" PREVIOUS="name" NEXT="description"/>
688 <FIELD NAME="description" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" PREVIOUS="scale"/>
d3f31bf2 689 </FIELDS>
690 <KEYS>
7529139a 691 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="oldid"/>
d3f31bf2 692 <KEY NAME="oldid" TYPE="foreign" FIELDS="oldid" REFTABLE="scale" REFFIELDS="id" PREVIOUS="primary" NEXT="courseid"/>
693 <KEY NAME="courseid" TYPE="foreign" FIELDS="courseid" REFTABLE="course" REFFIELDS="id" PREVIOUS="oldid" NEXT="loggeduser"/>
694 <KEY NAME="loggeduser" TYPE="foreign" FIELDS="loggeduser" REFTABLE="user" REFFIELDS="id" PREVIOUS="courseid"/>
695 </KEYS>
696 <INDEXES>
697 <INDEX NAME="action" UNIQUE="false" FIELDS="action" COMMENT="insert/update/delete"/>
698 </INDEXES>
699 </TABLE>
700 <TABLE NAME="stats_daily" COMMENT="to accumulate daily stats" PREVIOUS="scale_history" NEXT="stats_weekly">
67d7d694 701 <FIELDS>
74c288a1 702 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="courseid"/>
703 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="timeend"/>
704 <FIELD NAME="timeend" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="courseid" NEXT="roleid"/>
705 <FIELD NAME="roleid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="id of role for the aggregates" PREVIOUS="timeend" NEXT="stattype"/>
706 <FIELD NAME="stattype" TYPE="char" LENGTH="20" NOTNULL="true" DEFAULT="activity" SEQUENCE="false" COMMENT="type of stat" PREVIOUS="roleid" NEXT="stat1"/>
707 <FIELD NAME="stat1" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="stat1. usually used for reads" PREVIOUS="stattype" NEXT="stat2"/>
708 <FIELD NAME="stat2" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="stat2. usually used for writes." PREVIOUS="stat1"/>
67d7d694 709 </FIELDS>
710 <KEYS>
52cb2e47 711 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
67d7d694 712 </KEYS>
713 <INDEXES>
714 <INDEX NAME="courseid" UNIQUE="false" FIELDS="courseid" NEXT="timeend"/>
504e6fd4 715 <INDEX NAME="timeend" UNIQUE="false" FIELDS="timeend" PREVIOUS="courseid" NEXT="roleid"/>
716 <INDEX NAME="roleid" UNIQUE="false" FIELDS="roleid" PREVIOUS="timeend"/>
67d7d694 717 </INDEXES>
718 </TABLE>
719 <TABLE NAME="stats_weekly" COMMENT="To accumulate weekly stats" PREVIOUS="stats_daily" NEXT="stats_monthly">
720 <FIELDS>
74c288a1 721 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="courseid"/>
722 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="timeend"/>
723 <FIELD NAME="timeend" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="courseid" NEXT="roleid"/>
724 <FIELD NAME="roleid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="id of role for the aggregates" PREVIOUS="timeend" NEXT="stattype"/>
725 <FIELD NAME="stattype" TYPE="char" LENGTH="20" NOTNULL="true" DEFAULT="activity" SEQUENCE="false" COMMENT="type of stat" PREVIOUS="roleid" NEXT="stat1"/>
726 <FIELD NAME="stat1" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="stat1. usually used for reads" PREVIOUS="stattype" NEXT="stat2"/>
727 <FIELD NAME="stat2" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="stat2. usually used for writes." PREVIOUS="stat1"/>
67d7d694 728 </FIELDS>
729 <KEYS>
52cb2e47 730 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
67d7d694 731 </KEYS>
732 <INDEXES>
733 <INDEX NAME="courseid" UNIQUE="false" FIELDS="courseid" NEXT="timeend"/>
504e6fd4 734 <INDEX NAME="timeend" UNIQUE="false" FIELDS="timeend" PREVIOUS="courseid" NEXT="roleid"/>
735 <INDEX NAME="roleid" UNIQUE="false" FIELDS="roleid" PREVIOUS="timeend"/>
67d7d694 736 </INDEXES>
737 </TABLE>
738 <TABLE NAME="stats_monthly" COMMENT="To accumulate monthly stats" PREVIOUS="stats_weekly" NEXT="stats_user_daily">
739 <FIELDS>
74c288a1 740 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="courseid"/>
741 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="timeend"/>
742 <FIELD NAME="timeend" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="courseid" NEXT="roleid"/>
743 <FIELD NAME="roleid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="id of role for the aggregates" PREVIOUS="timeend" NEXT="stattype"/>
744 <FIELD NAME="stattype" TYPE="char" LENGTH="20" NOTNULL="true" DEFAULT="activity" SEQUENCE="false" COMMENT="type of stat" PREVIOUS="roleid" NEXT="stat1"/>
745 <FIELD NAME="stat1" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="stat1. usually used for reads" PREVIOUS="stattype" NEXT="stat2"/>
746 <FIELD NAME="stat2" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="stat2. usually used for writes." PREVIOUS="stat1"/>
67d7d694 747 </FIELDS>
748 <KEYS>
52cb2e47 749 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
67d7d694 750 </KEYS>
751 <INDEXES>
752 <INDEX NAME="courseid" UNIQUE="false" FIELDS="courseid" NEXT="timeend"/>
504e6fd4 753 <INDEX NAME="timeend" UNIQUE="false" FIELDS="timeend" PREVIOUS="courseid" NEXT="roleid"/>
754 <INDEX NAME="roleid" UNIQUE="false" FIELDS="roleid" PREVIOUS="timeend"/>
67d7d694 755 </INDEXES>
756 </TABLE>
757 <TABLE NAME="stats_user_daily" COMMENT="To accumulate daily stats per course/user" PREVIOUS="stats_monthly" NEXT="stats_user_weekly">
758 <FIELDS>
74c288a1 759 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="courseid"/>
760 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="userid"/>
761 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="courseid" NEXT="roleid"/>
762 <FIELD NAME="roleid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="userid" NEXT="timeend"/>
763 <FIELD NAME="timeend" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="roleid" NEXT="statsreads"/>
764 <FIELD NAME="statsreads" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="timeend" NEXT="statswrites"/>
765 <FIELD NAME="statswrites" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="statsreads" NEXT="stattype"/>
766 <FIELD NAME="stattype" TYPE="char" LENGTH="30" NOTNULL="true" SEQUENCE="false" PREVIOUS="statswrites"/>
67d7d694 767 </FIELDS>
768 <KEYS>
52cb2e47 769 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
67d7d694 770 </KEYS>
771 <INDEXES>
772 <INDEX NAME="courseid" UNIQUE="false" FIELDS="courseid" NEXT="userid"/>
773 <INDEX NAME="userid" UNIQUE="false" FIELDS="userid" PREVIOUS="courseid" NEXT="roleid"/>
774 <INDEX NAME="roleid" UNIQUE="false" FIELDS="roleid" PREVIOUS="userid" NEXT="timeend"/>
775 <INDEX NAME="timeend" UNIQUE="false" FIELDS="timeend" PREVIOUS="roleid"/>
776 </INDEXES>
777 </TABLE>
778 <TABLE NAME="stats_user_weekly" COMMENT="To accumulate weekly stats per course/user" PREVIOUS="stats_user_daily" NEXT="stats_user_monthly">
779 <FIELDS>
74c288a1 780 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="courseid"/>
781 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="userid"/>
782 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="courseid" NEXT="roleid"/>
783 <FIELD NAME="roleid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="userid" NEXT="timeend"/>
784 <FIELD NAME="timeend" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="roleid" NEXT="statsreads"/>
785 <FIELD NAME="statsreads" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="timeend" NEXT="statswrites"/>
786 <FIELD NAME="statswrites" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="statsreads" NEXT="stattype"/>
787 <FIELD NAME="stattype" TYPE="char" LENGTH="30" NOTNULL="true" SEQUENCE="false" PREVIOUS="statswrites"/>
67d7d694 788 </FIELDS>
789 <KEYS>
52cb2e47 790 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
67d7d694 791 </KEYS>
792 <INDEXES>
793 <INDEX NAME="courseid" UNIQUE="false" FIELDS="courseid" NEXT="userid"/>
794 <INDEX NAME="userid" UNIQUE="false" FIELDS="userid" PREVIOUS="courseid" NEXT="roleid"/>
795 <INDEX NAME="roleid" UNIQUE="false" FIELDS="roleid" PREVIOUS="userid" NEXT="timeend"/>
796 <INDEX NAME="timeend" UNIQUE="false" FIELDS="timeend" PREVIOUS="roleid"/>
797 </INDEXES>
798 </TABLE>
799 <TABLE NAME="stats_user_monthly" COMMENT="To accumulate monthly stats per course/user" PREVIOUS="stats_user_weekly" NEXT="post">
800 <FIELDS>
74c288a1 801 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="courseid"/>
802 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="userid"/>
803 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="courseid" NEXT="roleid"/>
804 <FIELD NAME="roleid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="userid" NEXT="timeend"/>
805 <FIELD NAME="timeend" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="roleid" NEXT="statsreads"/>
806 <FIELD NAME="statsreads" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="timeend" NEXT="statswrites"/>
807 <FIELD NAME="statswrites" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="statsreads" NEXT="stattype"/>
808 <FIELD NAME="stattype" TYPE="char" LENGTH="30" NOTNULL="true" SEQUENCE="false" PREVIOUS="statswrites"/>
67d7d694 809 </FIELDS>
810 <KEYS>
52cb2e47 811 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
67d7d694 812 </KEYS>
813 <INDEXES>
814 <INDEX NAME="courseid" UNIQUE="false" FIELDS="courseid" NEXT="userid"/>
815 <INDEX NAME="userid" UNIQUE="false" FIELDS="userid" PREVIOUS="courseid" NEXT="roleid"/>
816 <INDEX NAME="roleid" UNIQUE="false" FIELDS="roleid" PREVIOUS="userid" NEXT="timeend"/>
817 <INDEX NAME="timeend" UNIQUE="false" FIELDS="timeend" PREVIOUS="roleid"/>
818 </INDEXES>
819 </TABLE>
0e80ffb2 820 <TABLE NAME="post" COMMENT="Generic post table to hold data blog entries etc in different modules" PREVIOUS="stats_user_monthly" NEXT="role">
67d7d694 821 <FIELDS>
74c288a1 822 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="module"/>
823 <FIELD NAME="module" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" PREVIOUS="id" NEXT="userid"/>
824 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="module" NEXT="courseid"/>
825 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="userid" NEXT="groupid"/>
826 <FIELD NAME="groupid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="courseid" NEXT="moduleid"/>
827 <FIELD NAME="moduleid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="groupid" NEXT="coursemoduleid"/>
828 <FIELD NAME="coursemoduleid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="moduleid" NEXT="subject"/>
829 <FIELD NAME="subject" TYPE="char" LENGTH="128" NOTNULL="true" SEQUENCE="false" PREVIOUS="coursemoduleid" NEXT="summary"/>
830 <FIELD NAME="summary" TYPE="text" LENGTH="big" NOTNULL="false" SEQUENCE="false" PREVIOUS="subject" NEXT="content"/>
831 <FIELD NAME="content" TYPE="text" LENGTH="big" NOTNULL="false" SEQUENCE="false" PREVIOUS="summary" NEXT="uniquehash"/>
832 <FIELD NAME="uniquehash" TYPE="char" LENGTH="128" NOTNULL="true" SEQUENCE="false" PREVIOUS="content" NEXT="rating"/>
833 <FIELD NAME="rating" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="uniquehash" NEXT="format"/>
cae83708 834 <FIELD NAME="format" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="rating" NEXT="summaryformat"/>
835 <FIELD NAME="summaryformat" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="format" NEXT="attachment"/>
836 <FIELD NAME="attachment" TYPE="char" LENGTH="100" NOTNULL="false" SEQUENCE="false" COMMENT="attachment" PREVIOUS="summaryformat" NEXT="publishstate"/>
74c288a1 837 <FIELD NAME="publishstate" TYPE="char" LENGTH="20" NOTNULL="true" DEFAULT="draft" SEQUENCE="false" PREVIOUS="attachment" NEXT="lastmodified"/>
838 <FIELD NAME="lastmodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="publishstate" NEXT="created"/>
839 <FIELD NAME="created" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="lastmodified" NEXT="usermodified"/>
840 <FIELD NAME="usermodified" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" PREVIOUS="created"/>
67d7d694 841 </FIELDS>
842 <KEYS>
28271c72 843 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="usermodified"/>
7529139a 844 <KEY NAME="usermodified" TYPE="foreign" FIELDS="usermodified" REFTABLE="user" REFFIELDS="id" PREVIOUS="primary"/>
67d7d694 845 </KEYS>
846 <INDEXES>
847 <INDEX NAME="id-userid" UNIQUE="true" FIELDS="id, userid" NEXT="lastmodified"/>
848 <INDEX NAME="lastmodified" UNIQUE="false" FIELDS="lastmodified" PREVIOUS="id-userid" NEXT="module"/>
849 <INDEX NAME="module" UNIQUE="false" FIELDS="module" PREVIOUS="lastmodified" NEXT="subject"/>
850 <INDEX NAME="subject" UNIQUE="false" FIELDS="subject" PREVIOUS="module"/>
851 </INDEXES>
852 </TABLE>
0e80ffb2 853 <TABLE NAME="role" COMMENT="moodle roles" PREVIOUS="post" NEXT="context">
5a1d8354 854 <FIELDS>
74c288a1 855 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="name"/>
856 <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="id" NEXT="shortname"/>
857 <FIELD NAME="shortname" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" PREVIOUS="name" NEXT="description"/>
858 <FIELD NAME="description" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" PREVIOUS="shortname" NEXT="sortorder"/>
4f0c2d00
PS
859 <FIELD NAME="sortorder" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="description" NEXT="archetype"/>
860 <FIELD NAME="archetype" TYPE="char" LENGTH="30" NOTNULL="true" SEQUENCE="false" COMMENT="Role archetype is used during install and role reset, marks admin role and helps in site settings" PREVIOUS="sortorder"/>
5a1d8354 861 </FIELDS>
862 <KEYS>
52cb2e47 863 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
5a1d8354 864 </KEYS>
a1bdf659 865 <INDEXES>
40c792c3 866 <INDEX NAME="sortorder" UNIQUE="true" FIELDS="sortorder" NEXT="name"/>
867 <INDEX NAME="name" UNIQUE="true" FIELDS="name" COMMENT="Enforces the constraint that role names should be unique." PREVIOUS="sortorder" NEXT="shortname"/>
868 <INDEX NAME="shortname" UNIQUE="true" FIELDS="shortname" COMMENT="Enforces the constraint that role shortnames must be unique." PREVIOUS="name"/>
a1bdf659 869 </INDEXES>
5a1d8354 870 </TABLE>
a506e40c 871 <TABLE NAME="context" COMMENT="one of these must be set" PREVIOUS="role" NEXT="context_temp">
5a1d8354 872 <FIELDS>
74c288a1 873 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="contextlevel"/>
874 <FIELD NAME="contextlevel" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="instanceid"/>
875 <FIELD NAME="instanceid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="contextlevel" NEXT="path"/>
876 <FIELD NAME="path" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" PREVIOUS="instanceid" NEXT="depth"/>
877 <FIELD NAME="depth" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="path"/>
5a1d8354 878 </FIELDS>
879 <KEYS>
52cb2e47 880 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
5a1d8354 881 </KEYS>
a1bdf659 882 <INDEXES>
aad2ba95 883 <INDEX NAME="contextlevel-instanceid" UNIQUE="true" FIELDS="contextlevel, instanceid" NEXT="instanceid"/>
c7c57cfb 884 <INDEX NAME="instanceid" UNIQUE="false" FIELDS="instanceid" PREVIOUS="contextlevel-instanceid" NEXT="path"/>
885 <INDEX NAME="path" UNIQUE="false" FIELDS="path" PREVIOUS="instanceid"/>
a1bdf659 886 </INDEXES>
887 </TABLE>
a506e40c 888 <TABLE NAME="context_temp" COMMENT="Used by build_context_path() in upgrade and cron to keep context depths and paths in sync." PREVIOUS="context" NEXT="capabilities">
d5d2f8a6 889 <FIELDS>
74c288a1 890 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="This id isn't autonumeric/sequence. It's the context-&gt;id" NEXT="path"/>
891 <FIELD NAME="path" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="id" NEXT="depth"/>
892 <FIELD NAME="depth" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="path"/>
d5d2f8a6 893 </FIELDS>
894 <KEYS>
52cb2e47 895 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
d5d2f8a6 896 </KEYS>
897 </TABLE>
898 <TABLE NAME="capabilities" COMMENT="this defines all capabilities" PREVIOUS="context_temp" NEXT="role_allow_assign">
a1bdf659 899 <FIELDS>
74c288a1 900 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="name"/>
901 <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="id" NEXT="captype"/>
902 <FIELD NAME="captype" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" PREVIOUS="name" NEXT="contextlevel"/>
903 <FIELD NAME="contextlevel" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="captype" NEXT="component"/>
904 <FIELD NAME="component" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" PREVIOUS="contextlevel" NEXT="riskbitmask"/>
905 <FIELD NAME="riskbitmask" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="component"/>
a1bdf659 906 </FIELDS>
907 <KEYS>
28271c72 908 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="name"/>
a1bdf659 909 <KEY NAME="name" TYPE="unique" FIELDS="name" PREVIOUS="primary"/>
910 </KEYS>
5a1d8354 911 </TABLE>
de16da72 912 <TABLE NAME="role_allow_assign" COMMENT="this defines what role can assign what role" PREVIOUS="capabilities" NEXT="role_allow_override">
913 <FIELDS>
74c288a1 914 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="roleid"/>
915 <FIELD NAME="roleid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="allowassign"/>
916 <FIELD NAME="allowassign" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="roleid"/>
de16da72 917 </FIELDS>
918 <KEYS>
28271c72 919 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="roleid"/>
de16da72 920 <KEY NAME="roleid" TYPE="foreign" FIELDS="roleid" REFTABLE="role" REFFIELDS="id" PREVIOUS="primary" NEXT="allowassign"/>
921 <KEY NAME="allowassign" TYPE="foreign" FIELDS="allowassign" REFTABLE="role" REFFIELDS="id" PREVIOUS="roleid"/>
922 </KEYS>
923 <INDEXES>
924 <INDEX NAME="roleid-allowassign" UNIQUE="true" FIELDS="roleid, allowassign"/>
925 </INDEXES>
926 </TABLE>
82701e24 927 <TABLE NAME="role_allow_override" COMMENT="this defines what role can override what role" PREVIOUS="role_allow_assign" NEXT="role_allow_switch">
de16da72 928 <FIELDS>
74c288a1 929 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="roleid"/>
930 <FIELD NAME="roleid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="allowoverride"/>
931 <FIELD NAME="allowoverride" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="roleid"/>
de16da72 932 </FIELDS>
933 <KEYS>
28271c72 934 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="roleid"/>
de16da72 935 <KEY NAME="roleid" TYPE="foreign" FIELDS="roleid" REFTABLE="role" REFFIELDS="id" PREVIOUS="primary" NEXT="allowoverride"/>
936 <KEY NAME="allowoverride" TYPE="foreign" FIELDS="allowoverride" REFTABLE="role" REFFIELDS="id" PREVIOUS="roleid"/>
937 </KEYS>
938 <INDEXES>
939 <INDEX NAME="roleid-allowoverride" UNIQUE="true" FIELDS="roleid, allowoverride"/>
940 </INDEXES>
941 </TABLE>
82701e24 942 <TABLE NAME="role_allow_switch" COMMENT="This table stores which which other roles a user is allowed to switch to if they have one role." PREVIOUS="role_allow_override" NEXT="role_assignments">
943 <FIELDS>
74c288a1 944 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="roleid"/>
945 <FIELD NAME="roleid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="The role the user has." PREVIOUS="id" NEXT="allowswitch"/>
946 <FIELD NAME="allowswitch" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="The id of a role that the user is allowed to switch to as a result of having this role." PREVIOUS="roleid"/>
82701e24 947 </FIELDS>
948 <KEYS>
949 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="roleid"/>
950 <KEY NAME="roleid" TYPE="foreign" FIELDS="roleid" REFTABLE="role" REFFIELDS="id" PREVIOUS="primary" NEXT="allowswitch"/>
951 <KEY NAME="allowswitch" TYPE="foreign" FIELDS="allowswitch" REFTABLE="role" REFFIELDS="id" PREVIOUS="roleid"/>
952 </KEYS>
953 <INDEXES>
954 <INDEX NAME="roleid-allowoverride" UNIQUE="true" FIELDS="roleid, allowswitch" COMMENT="Each pair (roleid, allowswitch) must appear at most once."/>
955 </INDEXES>
956 </TABLE>
957 <TABLE NAME="role_assignments" COMMENT="assigning roles to different context" PREVIOUS="role_allow_switch" NEXT="role_capabilities">
5a1d8354 958 <FIELDS>
74c288a1 959 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="roleid"/>
960 <FIELD NAME="roleid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="contextid"/>
961 <FIELD NAME="contextid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="roleid" NEXT="userid"/>
962 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="contextid" NEXT="hidden"/>
963 <FIELD NAME="hidden" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="userid" NEXT="timestart"/>
964 <FIELD NAME="timestart" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="hidden" NEXT="timeend"/>
965 <FIELD NAME="timeend" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="timestart" NEXT="timemodified"/>
966 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="timeend" NEXT="modifierid"/>
967 <FIELD NAME="modifierid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="timemodified" NEXT="enrol"/>
968 <FIELD NAME="enrol" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" PREVIOUS="modifierid" NEXT="sortorder"/>
969 <FIELD NAME="sortorder" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="enrol"/>
5a1d8354 970 </FIELDS>
971 <KEYS>
28271c72 972 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="roleid"/>
a1bdf659 973 <KEY NAME="roleid" TYPE="foreign" FIELDS="roleid" REFTABLE="role" REFFIELDS="id" PREVIOUS="primary" NEXT="contextid"/>
974 <KEY NAME="contextid" TYPE="foreign" FIELDS="contextid" REFTABLE="context" REFFIELDS="id" PREVIOUS="roleid" NEXT="userid"/>
975 <KEY NAME="userid" TYPE="foreign" FIELDS="userid" REFTABLE="user" REFFIELDS="id" PREVIOUS="contextid"/>
5a1d8354 976 </KEYS>
a1bdf659 977 <INDEXES>
978 <INDEX NAME="contextid-roleid-userid" UNIQUE="true" FIELDS="contextid, roleid, userid" NEXT="sortorder"/>
979 <INDEX NAME="sortorder" UNIQUE="false" FIELDS="sortorder" PREVIOUS="contextid-roleid-userid"/>
980 </INDEXES>
5a1d8354 981 </TABLE>
de16da72 982 <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 983 <FIELDS>
74c288a1 984 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="contextid"/>
985 <FIELD NAME="contextid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="roleid"/>
986 <FIELD NAME="roleid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="contextid" NEXT="capability"/>
987 <FIELD NAME="capability" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="roleid" NEXT="permission"/>
988 <FIELD NAME="permission" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" PREVIOUS="capability" NEXT="timemodified"/>
989 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="permission" NEXT="modifierid"/>
990 <FIELD NAME="modifierid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="timemodified"/>
5a1d8354 991 </FIELDS>
992 <KEYS>
28271c72 993 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="roleid"/>
a1bdf659 994 <KEY NAME="roleid" TYPE="foreign" FIELDS="roleid" REFTABLE="role" REFFIELDS="id" PREVIOUS="primary" NEXT="contextid"/>
995 <KEY NAME="contextid" TYPE="foreign" FIELDS="contextid" REFTABLE="context" REFFIELDS="id" PREVIOUS="roleid" NEXT="modifierid"/>
996 <KEY NAME="modifierid" TYPE="foreign" FIELDS="modifierid" REFTABLE="user" REFFIELDS="id" PREVIOUS="contextid" NEXT="capability"/>
997 <KEY NAME="capability" TYPE="foreign" FIELDS="capability" REFTABLE="capabilities" REFFIELDS="name" PREVIOUS="modifierid"/>
5a1d8354 998 </KEYS>
a1bdf659 999 <INDEXES>
1000 <INDEX NAME="roleid-contextid-capability" UNIQUE="true" FIELDS="roleid, contextid, capability"/>
1001 </INDEXES>
5a1d8354 1002 </TABLE>
b318ecfd 1003 <TABLE NAME="role_names" COMMENT="role names in native strings" PREVIOUS="role_capabilities" NEXT="role_sortorder">
5a1d8354 1004 <FIELDS>
74c288a1 1005 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="roleid"/>
1006 <FIELD NAME="roleid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="contextid"/>
1007 <FIELD NAME="contextid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="roleid" NEXT="name"/>
1008 <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="contextid"/>
5a1d8354 1009 </FIELDS>
1010 <KEYS>
28271c72 1011 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="roleid"/>
7529139a 1012 <KEY NAME="roleid" TYPE="foreign" FIELDS="roleid" REFTABLE="role" REFFIELDS="id" PREVIOUS="primary" NEXT="contextid"/>
a1bdf659 1013 <KEY NAME="contextid" TYPE="foreign" FIELDS="contextid" REFTABLE="context" REFFIELDS="id" PREVIOUS="roleid"/>
5a1d8354 1014 </KEYS>
a1bdf659 1015 <INDEXES>
1016 <INDEX NAME="roleid-contextid" UNIQUE="true" FIELDS="roleid, contextid"/>
1017 </INDEXES>
5a1d8354 1018 </TABLE>
01a80f51 1019 <TABLE NAME="role_sortorder" COMMENT="sort order of course managers in a course" PREVIOUS="role_names" NEXT="role_context_levels">
b318ecfd 1020 <FIELDS>
74c288a1 1021 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="userid"/>
1022 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="id" NEXT="roleid"/>
1023 <FIELD NAME="roleid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="userid" NEXT="contextid"/>
1024 <FIELD NAME="contextid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="roleid" NEXT="sortoder"/>
1025 <FIELD NAME="sortoder" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="false" PREVIOUS="contextid"/>
b318ecfd 1026 </FIELDS>
1027 <KEYS>
7529139a 1028 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="userid"/>
b318ecfd 1029 <KEY NAME="userid" TYPE="foreign" FIELDS="userid" REFTABLE="user" REFFIELDS="id" PREVIOUS="primary" NEXT="roleid"/>
1030 <KEY NAME="roleid" TYPE="foreign" FIELDS="roleid" REFTABLE="role" REFFIELDS="id" PREVIOUS="userid" NEXT="contextid"/>
1031 <KEY NAME="contextid" TYPE="foreign" FIELDS="contextid" REFTABLE="context" REFFIELDS="id" PREVIOUS="roleid"/>
1032 </KEYS>
1033 <INDEXES>
1034 <INDEX NAME="userid-roleid-contextid" UNIQUE="true" FIELDS="userid, roleid, contextid"/>
1035 </INDEXES>
1036 </TABLE>
01a80f51 1037 <TABLE NAME="role_context_levels" COMMENT="Lists which roles can be assigned at which context levels. The assignment is allowed in the corresponding row is present in this table." PREVIOUS="role_sortorder" NEXT="user_info_field">
1038 <FIELDS>
74c288a1 1039 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="roleid"/>
1040 <FIELD NAME="roleid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="id" NEXT="contextlevel"/>
1041 <FIELD NAME="contextlevel" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="roleid"/>
01a80f51 1042 </FIELDS>
1043 <KEYS>
1044 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="contextlevel-roleid"/>
1045 <KEY NAME="contextlevel-roleid" TYPE="unique" FIELDS="contextlevel, roleid" PREVIOUS="primary" NEXT="roleid"/>
1046 <KEY NAME="roleid" TYPE="foreign" FIELDS="roleid" REFTABLE="role" REFFIELDS="id" PREVIOUS="contextlevel-roleid"/>
1047 </KEYS>
1048 </TABLE>
1049 <TABLE NAME="user_info_field" COMMENT="Customisable user profile fields" PREVIOUS="role_context_levels" NEXT="user_info_category">
adecf1c4 1050 <FIELDS>
74c288a1 1051 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="shortname"/>
1052 <FIELD NAME="shortname" TYPE="char" LENGTH="255" NOTNULL="true" DEFAULT="shortname" SEQUENCE="false" COMMENT="short name for each field" PREVIOUS="id" NEXT="name"/>
1053 <FIELD NAME="name" TYPE="text" LENGTH="big" NOTNULL="true" SEQUENCE="false" COMMENT="field name" PREVIOUS="shortname" NEXT="datatype"/>
1054 <FIELD NAME="datatype" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="Type of data held in this field" PREVIOUS="name" NEXT="description"/>
8bdc9cac
SH
1055 <FIELD NAME="description" TYPE="text" LENGTH="big" NOTNULL="false" SEQUENCE="false" COMMENT="Description of field" PREVIOUS="datatype" NEXT="descriptionformat"/>
1056 <FIELD NAME="descriptionformat" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="description" NEXT="categoryid"/>
1057 <FIELD NAME="categoryid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="id from category table" PREVIOUS="descriptionformat" NEXT="sortorder"/>
74c288a1 1058 <FIELD NAME="sortorder" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="order within the category" PREVIOUS="categoryid" NEXT="required"/>
1059 <FIELD NAME="required" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Field required" PREVIOUS="sortorder" NEXT="locked"/>
1060 <FIELD NAME="locked" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Field locked" PREVIOUS="required" NEXT="visible"/>
1061 <FIELD NAME="visible" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Visibility: private, public, hidden" PREVIOUS="locked" NEXT="forceunique"/>
1062 <FIELD NAME="forceunique" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="should the field contain unique data" PREVIOUS="visible" NEXT="signup"/>
1063 <FIELD NAME="signup" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="display field on signup page" PREVIOUS="forceunique" NEXT="defaultdata"/>
8bdc9cac
SH
1064 <FIELD NAME="defaultdata" TYPE="text" LENGTH="big" NOTNULL="false" SEQUENCE="false" COMMENT="Default value for this field" PREVIOUS="signup" NEXT="defaultdataformat"/>
1065 <FIELD NAME="defaultdataformat" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="defaultdata" NEXT="param1"/>
1066 <FIELD NAME="param1" TYPE="text" LENGTH="big" NOTNULL="false" SEQUENCE="false" COMMENT="General parameter field" PREVIOUS="defaultdataformat" NEXT="param2"/>
74c288a1 1067 <FIELD NAME="param2" TYPE="text" LENGTH="big" NOTNULL="false" SEQUENCE="false" COMMENT="General parameter field" PREVIOUS="param1" NEXT="param3"/>
1068 <FIELD NAME="param3" TYPE="text" LENGTH="big" NOTNULL="false" SEQUENCE="false" COMMENT="General parameter field" PREVIOUS="param2" NEXT="param4"/>
1069 <FIELD NAME="param4" TYPE="text" LENGTH="big" NOTNULL="false" SEQUENCE="false" COMMENT="General parameter field" PREVIOUS="param3" NEXT="param5"/>
1070 <FIELD NAME="param5" TYPE="text" LENGTH="big" NOTNULL="false" SEQUENCE="false" COMMENT="General parameter field" PREVIOUS="param4"/>
adecf1c4 1071 </FIELDS>
1072 <KEYS>
52cb2e47 1073 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
adecf1c4 1074 </KEYS>
1075 </TABLE>
1076 <TABLE NAME="user_info_category" COMMENT="Customisable fields categories" PREVIOUS="user_info_field" NEXT="user_info_data">
1077 <FIELDS>
74c288a1 1078 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="name"/>
1079 <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="Category name" PREVIOUS="id" NEXT="sortorder"/>
1080 <FIELD NAME="sortorder" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Display order" PREVIOUS="name"/>
adecf1c4 1081 </FIELDS>
1082 <KEYS>
52cb2e47 1083 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
adecf1c4 1084 </KEYS>
1085 </TABLE>
4f089b21 1086 <TABLE NAME="user_info_data" COMMENT="Data for the customisable user fields" PREVIOUS="user_info_category" NEXT="question_categories">
adecf1c4 1087 <FIELDS>
74c288a1 1088 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="userid"/>
1089 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="id from the user table" PREVIOUS="id" NEXT="fieldid"/>
1090 <FIELD NAME="fieldid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="id from the field table" PREVIOUS="userid" NEXT="data"/>
8bdc9cac
SH
1091 <FIELD NAME="data" TYPE="text" LENGTH="big" NOTNULL="true" SEQUENCE="false" COMMENT="Field data" PREVIOUS="fieldid" NEXT="dataformat"/>
1092 <FIELD NAME="dataformat" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="data"/>
adecf1c4 1093 </FIELDS>
1094 <KEYS>
52cb2e47 1095 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
adecf1c4 1096 </KEYS>
1097 </TABLE>
4f089b21 1098 <TABLE NAME="question_categories" COMMENT="Categories are for grouping questions" PREVIOUS="user_info_data" NEXT="question">
1099 <FIELDS>
74c288a1 1100 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="name"/>
1101 <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="id" NEXT="contextid"/>
1102 <FIELD NAME="contextid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="context that this category is shared in" PREVIOUS="name" NEXT="info"/>
1103 <FIELD NAME="info" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" PREVIOUS="contextid" NEXT="stamp"/>
1104 <FIELD NAME="stamp" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="info" NEXT="parent"/>
1105 <FIELD NAME="parent" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="stamp" NEXT="sortorder"/>
1106 <FIELD NAME="sortorder" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="999" SEQUENCE="false" PREVIOUS="parent"/>
4f089b21 1107 </FIELDS>
1108 <KEYS>
1109 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="parent"/>
1110 <KEY NAME="parent" TYPE="foreign" FIELDS="parent" REFTABLE="question_categories" REFFIELDS="id" COMMENT="note that to make this recursive FK working someday, the parent field must be declared NULL" PREVIOUS="primary"/>
1111 </KEYS>
1112 <INDEXES>
1113 <INDEX NAME="contextid" UNIQUE="false" FIELDS="contextid" COMMENT="links to context table"/>
1114 </INDEXES>
1115 </TABLE>
1116 <TABLE NAME="question" COMMENT="The questions themselves" PREVIOUS="question_categories" NEXT="question_answers">
1117 <FIELDS>
74c288a1 1118 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="category"/>
1119 <FIELD NAME="category" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="parent"/>
1120 <FIELD NAME="parent" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="category" NEXT="name"/>
1121 <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="parent" NEXT="questiontext"/>
1122 <FIELD NAME="questiontext" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" PREVIOUS="name" NEXT="questiontextformat"/>
1123 <FIELD NAME="questiontextformat" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" PREVIOUS="questiontext" NEXT="image"/>
1124 <FIELD NAME="image" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="questiontextformat" NEXT="generalfeedback"/>
1125 <FIELD NAME="generalfeedback" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" COMMENT="to store the question feedback" PREVIOUS="image" NEXT="defaultgrade"/>
1126 <FIELD NAME="defaultgrade" TYPE="number" LENGTH="12" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" DECIMALS="7" PREVIOUS="generalfeedback" NEXT="penalty"/>
1127 <FIELD NAME="penalty" TYPE="number" LENGTH="12" NOTNULL="true" UNSIGNED="false" DEFAULT="0.1" SEQUENCE="false" DECIMALS="7" PREVIOUS="defaultgrade" NEXT="qtype"/>
1128 <FIELD NAME="qtype" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" PREVIOUS="penalty" NEXT="length"/>
1129 <FIELD NAME="length" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" PREVIOUS="qtype" NEXT="stamp"/>
1130 <FIELD NAME="stamp" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="length" NEXT="version"/>
1131 <FIELD NAME="version" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="stamp" NEXT="hidden"/>
1132 <FIELD NAME="hidden" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="version" NEXT="timecreated"/>
1133 <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="time question was created" PREVIOUS="hidden" NEXT="timemodified"/>
1134 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="time that question was last modified" PREVIOUS="timecreated" NEXT="createdby"/>
1135 <FIELD NAME="createdby" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="userid of person who created this question" PREVIOUS="timemodified" NEXT="modifiedby"/>
1136 <FIELD NAME="modifiedby" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="userid of person who last edited this question" PREVIOUS="createdby"/>
4f089b21 1137 </FIELDS>
1138 <KEYS>
1139 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="category"/>
1140 <KEY NAME="category" TYPE="foreign" FIELDS="category" REFTABLE="question_categories" REFFIELDS="id" PREVIOUS="primary" NEXT="parent"/>
1141 <KEY NAME="parent" TYPE="foreign" FIELDS="parent" REFTABLE="question" REFFIELDS="id" COMMENT="note that to make this recursive FK working someday, the parent field must be declared NULL" PREVIOUS="category" NEXT="createdby"/>
1142 <KEY NAME="createdby" TYPE="foreign" FIELDS="createdby" REFTABLE="user" REFFIELDS="id" COMMENT="foreign (createdby) references user (id)" PREVIOUS="parent" NEXT="modifiedby"/>
1143 <KEY NAME="modifiedby" TYPE="foreign" FIELDS="modifiedby" REFTABLE="user" REFFIELDS="id" COMMENT="foreign (modifiedby) references user (id)" PREVIOUS="createdby"/>
1144 </KEYS>
1145 </TABLE>
1146 <TABLE NAME="question_answers" COMMENT="Answers, with a fractional grade (0-1) and feedback" PREVIOUS="question" NEXT="question_attempts">
1147 <FIELDS>
74c288a1 1148 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="question"/>
1149 <FIELD NAME="question" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="answer"/>
1150 <FIELD NAME="answer" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" PREVIOUS="question" NEXT="fraction"/>
1151 <FIELD NAME="fraction" TYPE="number" LENGTH="12" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" DECIMALS="7" PREVIOUS="answer" NEXT="feedback"/>
1152 <FIELD NAME="feedback" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" PREVIOUS="fraction"/>
4f089b21 1153 </FIELDS>
1154 <KEYS>
1155 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="question"/>
1156 <KEY NAME="question" TYPE="foreign" FIELDS="question" REFTABLE="question" REFFIELDS="id" PREVIOUS="primary"/>
1157 </KEYS>
1158 </TABLE>
1159 <TABLE NAME="question_attempts" COMMENT="Student attempts. This table gets extended by the modules" PREVIOUS="question_answers" NEXT="question_states">
1160 <FIELDS>
74c288a1 1161 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="modulename"/>
1162 <FIELD NAME="modulename" TYPE="char" LENGTH="20" NOTNULL="true" DEFAULT="quiz" SEQUENCE="false" PREVIOUS="id"/>
4f089b21 1163 </FIELDS>
1164 <KEYS>
1165 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
1166 </KEYS>
1167 </TABLE>
1168 <TABLE NAME="question_states" COMMENT="Stores user responses to an attempt, and percentage grades" PREVIOUS="question_attempts" NEXT="question_sessions">
1169 <FIELDS>
74c288a1 1170 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="attempt"/>
1171 <FIELD NAME="attempt" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="question"/>
1172 <FIELD NAME="question" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="attempt" NEXT="seq_number"/>
1173 <FIELD NAME="seq_number" TYPE="int" LENGTH="6" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="question" NEXT="answer"/>
1174 <FIELD NAME="answer" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" PREVIOUS="seq_number" NEXT="timestamp"/>
1175 <FIELD NAME="timestamp" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="answer" NEXT="event"/>
1176 <FIELD NAME="event" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="timestamp" NEXT="grade"/>
1177 <FIELD NAME="grade" TYPE="number" LENGTH="12" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" DECIMALS="7" PREVIOUS="event" NEXT="raw_grade"/>
1178 <FIELD NAME="raw_grade" TYPE="number" LENGTH="12" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" DECIMALS="7" PREVIOUS="grade" NEXT="penalty"/>
1179 <FIELD NAME="penalty" TYPE="number" LENGTH="12" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" DECIMALS="7" PREVIOUS="raw_grade"/>
4f089b21 1180 </FIELDS>
1181 <KEYS>
1182 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="attempt"/>
1183 <KEY NAME="attempt" TYPE="foreign" FIELDS="attempt" REFTABLE="question_attempts" REFFIELDS="id" PREVIOUS="primary" NEXT="question"/>
1184 <KEY NAME="question" TYPE="foreign" FIELDS="question" REFTABLE="question" REFFIELDS="id" PREVIOUS="attempt"/>
1185 </KEYS>
1186 </TABLE>
1187 <TABLE NAME="question_sessions" COMMENT="Gives ids of the newest open and newest graded states" PREVIOUS="question_states" NEXT="mnet_enrol_course">
1188 <FIELDS>
74c288a1 1189 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="attemptid"/>
1190 <FIELD NAME="attemptid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="questionid"/>
1191 <FIELD NAME="questionid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="attemptid" NEXT="newest"/>
1192 <FIELD NAME="newest" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="questionid" NEXT="newgraded"/>
1193 <FIELD NAME="newgraded" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="newest" NEXT="sumpenalty"/>
1194 <FIELD NAME="sumpenalty" TYPE="number" LENGTH="12" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" DECIMALS="7" PREVIOUS="newgraded" NEXT="manualcomment"/>
1195 <FIELD NAME="manualcomment" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" PREVIOUS="sumpenalty" NEXT="flagged"/>
1196 <FIELD NAME="flagged" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" COMMENT="The person attempting the question may mark certain questions within their question_attempt if the module that owns the attempt allow it. This field stores the status of that flag." PREVIOUS="manualcomment"/>
4f089b21 1197 </FIELDS>
1198 <KEYS>
1199 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="attemptid"/>
1200 <KEY NAME="attemptid" TYPE="foreign" FIELDS="attemptid" REFTABLE="question_attempts" REFFIELDS="id" PREVIOUS="primary" NEXT="questionid"/>
1201 <KEY NAME="questionid" TYPE="foreign" FIELDS="questionid" REFTABLE="question" REFFIELDS="id" PREVIOUS="attemptid" NEXT="newest"/>
1202 <KEY NAME="newest" TYPE="foreign" FIELDS="newest" REFTABLE="question_states" REFFIELDS="id" PREVIOUS="questionid" NEXT="newgraded"/>
1203 <KEY NAME="newgraded" TYPE="foreign" FIELDS="newgraded" REFTABLE="question_states" REFFIELDS="id" PREVIOUS="newest"/>
1204 </KEYS>
1205 <INDEXES>
1206 <INDEX NAME="attemptid-questionid" UNIQUE="true" FIELDS="attemptid, questionid"/>
1207 </INDEXES>
1208 </TABLE>
1209 <TABLE NAME="mnet_enrol_course" COMMENT="Information about courses on remote hosts" PREVIOUS="question_sessions" NEXT="mnet_enrol_assignments">
9654f633 1210 <FIELDS>
74c288a1 1211 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" COMMENT="Unique remote-course ID" NEXT="hostid"/>
1212 <FIELD NAME="hostid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="remoteid"/>
1213 <FIELD NAME="remoteid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Unique ID of course on its home server" PREVIOUS="hostid" NEXT="cat_id"/>
1214 <FIELD NAME="cat_id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="remoteid" NEXT="cat_name"/>
1215 <FIELD NAME="cat_name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="cat_id" NEXT="cat_description"/>
1216 <FIELD NAME="cat_description" TYPE="text" LENGTH="medium" NOTNULL="true" SEQUENCE="false" PREVIOUS="cat_name" NEXT="sortorder"/>
1217 <FIELD NAME="sortorder" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="cat_description" NEXT="fullname"/>
1218 <FIELD NAME="fullname" TYPE="char" LENGTH="254" NOTNULL="true" SEQUENCE="false" PREVIOUS="sortorder" NEXT="shortname"/>
1219 <FIELD NAME="shortname" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" PREVIOUS="fullname" NEXT="idnumber"/>
1220 <FIELD NAME="idnumber" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" PREVIOUS="shortname" NEXT="summary"/>
1221 <FIELD NAME="summary" TYPE="text" LENGTH="medium" NOTNULL="true" SEQUENCE="false" PREVIOUS="idnumber" NEXT="startdate"/>
1222 <FIELD NAME="startdate" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="summary" NEXT="cost"/>
1223 <FIELD NAME="cost" TYPE="char" LENGTH="10" NOTNULL="true" SEQUENCE="false" PREVIOUS="startdate" NEXT="currency"/>
1224 <FIELD NAME="currency" TYPE="char" LENGTH="3" NOTNULL="true" SEQUENCE="false" PREVIOUS="cost" NEXT="defaultroleid"/>
1225 <FIELD NAME="defaultroleid" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="currency" NEXT="defaultrolename"/>
1226 <FIELD NAME="defaultrolename" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="defaultroleid"/>
9654f633 1227 </FIELDS>
1228 <KEYS>
1229 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the mnet_course table"/>
1230 </KEYS>
1231 <INDEXES>
0db6adc9 1232 <INDEX NAME="hostid_remoteid" UNIQUE="true" FIELDS="hostid, remoteid"/>
9654f633 1233 </INDEXES>
1234 </TABLE>
6392a62d 1235 <TABLE NAME="mnet_enrol_assignments" COMMENT="Information about enrolments on courses on remote hosts" PREVIOUS="mnet_enrol_course" NEXT="mnet_application">
9654f633 1236 <FIELDS>
74c288a1 1237 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" COMMENT="Unique enrollment ID" NEXT="userid"/>
1238 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Unique ID of user on *this* server" PREVIOUS="id" NEXT="hostid"/>
1239 <FIELD NAME="hostid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="userid" NEXT="courseid"/>
1240 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Unique ID of course on its home server" PREVIOUS="hostid" NEXT="rolename"/>
1241 <FIELD NAME="rolename" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="courseid" NEXT="enroltime"/>
1242 <FIELD NAME="enroltime" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="rolename" NEXT="enroltype"/>
1243 <FIELD NAME="enroltype" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" PREVIOUS="enroltime"/>
9654f633 1244 </FIELDS>
1245 <KEYS>
1246 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the mnet_enrol_assignments table"/>
1247 </KEYS>
1248 <INDEXES>
0db6adc9 1249 <INDEX NAME="hostid_courseid" UNIQUE="false" FIELDS="hostid, courseid" NEXT="userid"/>
9654f633 1250 <INDEX NAME="userid" UNIQUE="false" FIELDS="userid" PREVIOUS="hostid_courseid"/>
1251 </INDEXES>
1252 </TABLE>
6392a62d 1253 <TABLE NAME="mnet_application" COMMENT="Information about applications on remote hosts" PREVIOUS="mnet_enrol_assignments" NEXT="mnet_host">
1254 <FIELDS>
74c288a1 1255 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="name"/>
1256 <FIELD NAME="name" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" PREVIOUS="id" NEXT="display_name"/>
1257 <FIELD NAME="display_name" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" PREVIOUS="name" NEXT="xmlrpc_server_url"/>
1258 <FIELD NAME="xmlrpc_server_url" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="display_name" NEXT="sso_land_url"/>
1259 <FIELD NAME="sso_land_url" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="xmlrpc_server_url" NEXT="sso_jump_url"/>
1260 <FIELD NAME="sso_jump_url" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="sso_land_url"/>
6392a62d 1261 </FIELDS>
1262 <KEYS>
52cb2e47 1263 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
6392a62d 1264 </KEYS>
1265 </TABLE>
1266 <TABLE NAME="mnet_host" COMMENT="Information about the local and remote hosts for RPC" PREVIOUS="mnet_application" NEXT="mnet_host2service">
9654f633 1267 <FIELDS>
74c288a1 1268 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" COMMENT="Unique Host ID" NEXT="deleted"/>
1269 <FIELD NAME="deleted" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="wwwroot"/>
1270 <FIELD NAME="wwwroot" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="deleted" NEXT="ip_address"/>
1271 <FIELD NAME="ip_address" TYPE="char" LENGTH="45" NOTNULL="true" SEQUENCE="false" PREVIOUS="wwwroot" NEXT="name"/>
1272 <FIELD NAME="name" TYPE="char" LENGTH="80" NOTNULL="true" SEQUENCE="false" PREVIOUS="ip_address" NEXT="public_key"/>
1273 <FIELD NAME="public_key" TYPE="text" LENGTH="medium" NOTNULL="true" SEQUENCE="false" PREVIOUS="name" NEXT="public_key_expires"/>
1274 <FIELD NAME="public_key_expires" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="public_key" NEXT="transport"/>
1275 <FIELD NAME="transport" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="public_key_expires" NEXT="portno"/>
f6852f02 1276 <FIELD NAME="portno" TYPE="int" LENGTH="5" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="transport" NEXT="last_connect_time"/>
74c288a1 1277 <FIELD NAME="last_connect_time" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="portno" NEXT="last_log_id"/>
1278 <FIELD NAME="last_log_id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="last_connect_time" NEXT="force_theme"/>
1279 <FIELD NAME="force_theme" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="last_log_id" NEXT="theme"/>
1280 <FIELD NAME="theme" TYPE="char" LENGTH="100" NOTNULL="false" SEQUENCE="false" PREVIOUS="force_theme" NEXT="applicationid"/>
1281 <FIELD NAME="applicationid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" PREVIOUS="theme"/>
9654f633 1282 </FIELDS>
1283 <KEYS>
6392a62d 1284 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the mnet_host table" NEXT="applicationid"/>
1285 <KEY NAME="applicationid" TYPE="foreign" FIELDS="applicationid" REFTABLE="mnet_application" REFFIELDS="id" PREVIOUS="primary"/>
9654f633 1286 </KEYS>
1287 </TABLE>
1288 <TABLE NAME="mnet_host2service" COMMENT="Information about the services for a given host" PREVIOUS="mnet_host" NEXT="mnet_log">
1289 <FIELDS>
74c288a1 1290 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="hostid"/>
1291 <FIELD NAME="hostid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="serviceid"/>
1292 <FIELD NAME="serviceid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="hostid" NEXT="publish"/>
1293 <FIELD NAME="publish" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="serviceid" NEXT="subscribe"/>
1294 <FIELD NAME="subscribe" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="publish"/>
9654f633 1295 </FIELDS>
1296 <KEYS>
1297 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the mnet_host2service table"/>
1298 </KEYS>
1299 <INDEXES>
0db6adc9 1300 <INDEX NAME="hostid_serviceid" UNIQUE="true" FIELDS="hostid, serviceid"/>
9654f633 1301 </INDEXES>
1302 </TABLE>
1303 <TABLE NAME="mnet_log" COMMENT="Store session data from users migrating to other sites" PREVIOUS="mnet_host2service" NEXT="mnet_rpc">
1304 <FIELDS>
74c288a1 1305 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="hostid"/>
1306 <FIELD NAME="hostid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Unique host ID" PREVIOUS="id" NEXT="remoteid"/>
1307 <FIELD NAME="remoteid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="hostid" NEXT="time"/>
1308 <FIELD NAME="time" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="remoteid" NEXT="userid"/>
1309 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="time" NEXT="ip"/>
1310 <FIELD NAME="ip" TYPE="char" LENGTH="45" NOTNULL="true" SEQUENCE="false" PREVIOUS="userid" NEXT="course"/>
1311 <FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="ip" NEXT="coursename"/>
1312 <FIELD NAME="coursename" TYPE="char" LENGTH="40" NOTNULL="true" SEQUENCE="false" PREVIOUS="course" NEXT="module"/>
1313 <FIELD NAME="module" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" PREVIOUS="coursename" NEXT="cmid"/>
1314 <FIELD NAME="cmid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="module" NEXT="action"/>
1315 <FIELD NAME="action" TYPE="char" LENGTH="40" NOTNULL="true" SEQUENCE="false" PREVIOUS="cmid" NEXT="url"/>
1316 <FIELD NAME="url" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" PREVIOUS="action" NEXT="info"/>
1317 <FIELD NAME="info" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="url"/>
9654f633 1318 </FIELDS>
1319 <KEYS>
6e783f21 1320 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the mnet_log table"/>
9654f633 1321 </KEYS>
1322 <INDEXES>
1323 <INDEX NAME="hostid_userid_course" UNIQUE="false" FIELDS="hostid, userid, course"/>
1324 </INDEXES>
1325 </TABLE>
8586dbe2 1326 <TABLE NAME="mnet_rpc" COMMENT="Functions or methods that we may publish or subscribe to" PREVIOUS="mnet_log" NEXT="mnet_remote_rpc">
9654f633 1327 <FIELDS>
8586dbe2
PL
1328 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" COMMENT="Unique Function ID" NEXT="functionname"/>
1329 <FIELD NAME="functionname" TYPE="char" LENGTH="40" NOTNULL="true" SEQUENCE="false" PREVIOUS="id" NEXT="xmlrpcpath"/>
1330 <FIELD NAME="xmlrpcpath" TYPE="char" LENGTH="80" NOTNULL="true" SEQUENCE="false" PREVIOUS="functionname" NEXT="plugintype"/>
1331 <FIELD NAME="plugintype" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" PREVIOUS="xmlrpcpath" NEXT="pluginname"/>
de260e0f
PL
1332 <FIELD NAME="pluginname" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" PREVIOUS="plugintype" NEXT="enabled"/>
1333 <FIELD NAME="enabled" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="pluginname" NEXT="help"/>
74c288a1 1334 <FIELD NAME="help" TYPE="text" LENGTH="medium" NOTNULL="true" SEQUENCE="false" PREVIOUS="enabled" NEXT="profile"/>
de260e0f
PL
1335 <FIELD NAME="profile" TYPE="text" LENGTH="medium" NOTNULL="true" SEQUENCE="false" COMMENT="Method signature" PREVIOUS="help" NEXT="filename"/>
1336 <FIELD NAME="filename" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" PREVIOUS="profile" NEXT="classname"/>
1337 <FIELD NAME="classname" TYPE="char" LENGTH="150" NOTNULL="false" SEQUENCE="false" PREVIOUS="filename" NEXT="static"/>
1338 <FIELD NAME="static" TYPE="int" LENGTH="1" NOTNULL="false" UNSIGNED="false" SEQUENCE="false" PREVIOUS="classname"/>
9654f633 1339 </FIELDS>
1340 <KEYS>
1341 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the mnet_rpc table"/>
1342 </KEYS>
1343 <INDEXES>
8586dbe2 1344 <INDEX NAME="enabled_xmlrpcpath" UNIQUE="false" FIELDS="enabled, xmlrpcpath"/>
9654f633 1345 </INDEXES>
1346 </TABLE>
8586dbe2
PL
1347 <TABLE NAME="mnet_remote_rpc" COMMENT="This table describes functions that might be called remotely (we have less information about them than local functions)" PREVIOUS="mnet_rpc" NEXT="mnet_service">
1348 <FIELDS>
1349 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="functionname"/>
1350 <FIELD NAME="functionname" TYPE="char" LENGTH="40" NOTNULL="true" SEQUENCE="false" PREVIOUS="id" NEXT="xmlrpcpath"/>
a6e9dafe
PL
1351 <FIELD NAME="xmlrpcpath" TYPE="char" LENGTH="80" NOTNULL="true" SEQUENCE="false" PREVIOUS="functionname" NEXT="plugintype"/>
1352 <FIELD NAME="plugintype" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" PREVIOUS="xmlrpcpath" NEXT="pluginname"/>
5b7984a5
PL
1353 <FIELD NAME="pluginname" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" PREVIOUS="plugintype" NEXT="enabled"/>
1354 <FIELD NAME="enabled" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" SEQUENCE="false" PREVIOUS="pluginname"/>
8586dbe2
PL
1355 </FIELDS>
1356 <KEYS>
1357 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
1358 </KEYS>
1359 </TABLE>
1360 <TABLE NAME="mnet_service" COMMENT="A service is a group of functions" PREVIOUS="mnet_remote_rpc" NEXT="mnet_service2rpc">
9654f633 1361 <FIELDS>
74c288a1 1362 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" COMMENT="Unique Service ID" NEXT="name"/>
1363 <FIELD NAME="name" TYPE="char" LENGTH="40" NOTNULL="true" SEQUENCE="false" PREVIOUS="id" NEXT="description"/>
1364 <FIELD NAME="description" TYPE="char" LENGTH="40" NOTNULL="true" SEQUENCE="false" PREVIOUS="name" NEXT="apiversion"/>
1365 <FIELD NAME="apiversion" TYPE="char" LENGTH="10" NOTNULL="true" SEQUENCE="false" PREVIOUS="description" NEXT="offer"/>
1366 <FIELD NAME="offer" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Do we even offer this service?" PREVIOUS="apiversion"/>
9654f633 1367 </FIELDS>
1368 <KEYS>
1369 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the mnet_service table"/>
1370 </KEYS>
1371 </TABLE>
8586dbe2 1372 <TABLE NAME="mnet_service2rpc" COMMENT="Group functions or methods under a service" PREVIOUS="mnet_service" NEXT="mnet_remote_service2rpc">
9654f633 1373 <FIELDS>
74c288a1 1374 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" COMMENT="Required ID field" NEXT="serviceid"/>
1375 <FIELD NAME="serviceid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Unique service ID" PREVIOUS="id" NEXT="rpcid"/>
1376 <FIELD NAME="rpcid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Unique Function ID" PREVIOUS="serviceid"/>
9654f633 1377 </FIELDS>
1378 <KEYS>
1379 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the mnet_service2rpc table"/>
1380 </KEYS>
1381 <INDEXES>
1382 <INDEX NAME="rpcid_serviceid" UNIQUE="true" FIELDS="rpcid, serviceid"/>
1383 </INDEXES>
1384 </TABLE>
8586dbe2
PL
1385 <TABLE NAME="mnet_remote_service2rpc" COMMENT="Group functions or methods under a service" PREVIOUS="mnet_service2rpc" NEXT="mnet_session">
1386 <FIELDS>
1387 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" COMMENT="Required ID field" NEXT="serviceid"/>
1388 <FIELD NAME="serviceid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Unique service ID" PREVIOUS="id" NEXT="rpcid"/>
1389 <FIELD NAME="rpcid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Unique Function ID" PREVIOUS="serviceid"/>
1390 </FIELDS>
1391 <KEYS>
1392 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the mnet_remote_service2rpc table"/>
1393 </KEYS>
1394 <INDEXES>
1395 <INDEX NAME="rpcid_serviceid" UNIQUE="true" FIELDS="rpcid, serviceid"/>
1396 </INDEXES>
1397 </TABLE>
1398 <TABLE NAME="mnet_session" COMMENT="Store session data from users migrating to other sites" PREVIOUS="mnet_remote_service2rpc" NEXT="mnet_sso_access_control">
9654f633 1399 <FIELDS>
74c288a1 1400 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" COMMENT="Required ID field" NEXT="userid"/>
1401 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Unique user ID" PREVIOUS="id" NEXT="username"/>
1402 <FIELD NAME="username" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" COMMENT="Unique username" PREVIOUS="userid" NEXT="token"/>
1403 <FIELD NAME="token" TYPE="char" LENGTH="40" NOTNULL="true" SEQUENCE="false" COMMENT="Unique SHA1 Token" PREVIOUS="username" NEXT="mnethostid"/>
1404 <FIELD NAME="mnethostid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Unique remote host ID" PREVIOUS="token" NEXT="useragent"/>
1405 <FIELD NAME="useragent" TYPE="char" LENGTH="40" NOTNULL="true" SEQUENCE="false" COMMENT="SHA1 hash of User Agent" PREVIOUS="mnethostid" NEXT="confirm_timeout"/>
1406 <FIELD NAME="confirm_timeout" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="UNIX timestamp for expiry of session" PREVIOUS="useragent" NEXT="session_id"/>
1407 <FIELD NAME="session_id" TYPE="char" LENGTH="40" NOTNULL="true" SEQUENCE="false" COMMENT="The PHP Session ID" PREVIOUS="confirm_timeout" NEXT="expires"/>
1408 <FIELD NAME="expires" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Expire time of session on peer" PREVIOUS="session_id"/>
9654f633 1409 </FIELDS>
1410 <KEYS>
1411 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the mnet_session table"/>
1412 </KEYS>
1413 <INDEXES>
1414 <INDEX NAME="token" UNIQUE="true" FIELDS="token"/>
1415 </INDEXES>
1416 </TABLE>
6392a62d 1417 <TABLE NAME="mnet_sso_access_control" COMMENT="Users by host permitted (or not) to login from a remote provider" PREVIOUS="mnet_session" NEXT="events_queue">
9654f633 1418 <FIELDS>
74c288a1 1419 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" COMMENT="Required ID field" NEXT="username"/>
1420 <FIELD NAME="username" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" COMMENT="Username" PREVIOUS="id" NEXT="mnet_host_id"/>
1421 <FIELD NAME="mnet_host_id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="id of mnet host" PREVIOUS="username" NEXT="accessctrl"/>
1422 <FIELD NAME="accessctrl" TYPE="char" LENGTH="20" NOTNULL="true" DEFAULT="allow" SEQUENCE="false" COMMENT="Whether or not this user/host can login" PREVIOUS="mnet_host_id"/>
9654f633 1423 </FIELDS>
1424 <KEYS>
1425 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the mnet_sso_access_control table"/>
1426 </KEYS>
1427 <INDEXES>
1428 <INDEX NAME="mnethostid_username" UNIQUE="true" FIELDS="mnet_host_id, username"/>
1429 </INDEXES>
1430 </TABLE>
6392a62d 1431 <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="mnet_sso_access_control" NEXT="events_handlers">
d3f31bf2 1432 <FIELDS>
74c288a1 1433 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="eventdata"/>
1434 <FIELD NAME="eventdata" TYPE="text" LENGTH="big" NOTNULL="true" SEQUENCE="false" COMMENT="serialized version of the data object passed to the event handler." PREVIOUS="id" NEXT="stackdump"/>
1435 <FIELD NAME="stackdump" TYPE="text" LENGTH="medium" NOTNULL="false" SEQUENCE="false" COMMENT="serialized debug_backtrace showing where the event was fired from" PREVIOUS="eventdata" NEXT="userid"/>
1436 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="$USER-&amp;gt;id when the event was fired" PREVIOUS="stackdump" NEXT="timecreated"/>
1437 <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="time stamp of the first time this was added" PREVIOUS="userid"/>
d3f31bf2 1438 </FIELDS>
1439 <KEYS>
7529139a 1440 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="userid"/>
d3f31bf2 1441 <KEY NAME="userid" TYPE="foreign" FIELDS="userid" REFTABLE="user" REFFIELDS="id" PREVIOUS="primary"/>
1442 </KEYS>
1443 </TABLE>
1444 <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="events_queue" NEXT="events_queue_handlers">
ec36253d 1445 <FIELDS>
74c288a1 1446 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="eventname"/>
1447 <FIELD NAME="eventname" TYPE="char" LENGTH="166" NOTNULL="true" SEQUENCE="false" COMMENT="name of the event, e.g. 'grade_updated'" PREVIOUS="id" NEXT="handlermodule"/>
1448 <FIELD NAME="handlermodule" TYPE="char" LENGTH="166" NOTNULL="true" SEQUENCE="false" COMMENT="e.g. moodle, mod/forum, block/rss_client" PREVIOUS="eventname" NEXT="handlerfile"/>
1449 <FIELD NAME="handlerfile" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="path to the file of the function, eg /grade/export/lib.php" PREVIOUS="handlermodule" NEXT="handlerfunction"/>
1450 <FIELD NAME="handlerfunction" TYPE="text" LENGTH="medium" NOTNULL="false" SEQUENCE="false" COMMENT="serialized string or array describing function, suitable to be passed to call_user_func()" PREVIOUS="handlerfile" NEXT="schedule"/>
1451 <FIELD NAME="schedule" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" COMMENT="'cron' or 'instant'." PREVIOUS="handlerfunction" NEXT="status"/>
1452 <FIELD NAME="status" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="number of failed attempts to process this handler" PREVIOUS="schedule"/>
ec36253d 1453 </FIELDS>
1454 <KEYS>
52cb2e47 1455 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
ec36253d 1456 </KEYS>
1457 <INDEXES>
5cb564aa 1458 <INDEX NAME="eventname-handlermodule" UNIQUE="true" FIELDS="eventname, handlermodule"/>
ec36253d 1459 </INDEXES>
1460 </TABLE>
d3f31bf2 1461 <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_handlers" NEXT="grade_outcomes">
ec36253d 1462 <FIELDS>
74c288a1 1463 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="queuedeventid"/>
1464 <FIELD NAME="queuedeventid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="foreign key id corresponding to the id of the event_queues table" PREVIOUS="id" NEXT="handlerid"/>
1465 <FIELD NAME="handlerid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="foreign key id corresponding to the id of the event_handlers table" PREVIOUS="queuedeventid" NEXT="status"/>
1466 <FIELD NAME="status" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="false" SEQUENCE="false" COMMENT="number of failed attempts to process this handler" PREVIOUS="handlerid" NEXT="errormessage"/>
1467 <FIELD NAME="errormessage" TYPE="text" LENGTH="medium" NOTNULL="false" SEQUENCE="false" COMMENT="if an error happened last time we tried to process this event, record it here." PREVIOUS="status" NEXT="timemodified"/>
1468 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="time stamp of the last attempt to run this from the queue" PREVIOUS="errormessage"/>
ec36253d 1469 </FIELDS>
1470 <KEYS>
7529139a 1471 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="queuedeventid"/>
ec36253d 1472 <KEY NAME="queuedeventid" TYPE="foreign" FIELDS="queuedeventid" REFTABLE="events_queue" REFFIELDS="id" PREVIOUS="primary" NEXT="handlerid"/>
1473 <KEY NAME="handlerid" TYPE="foreign" FIELDS="handlerid" REFTABLE="events_handlers" REFFIELDS="id" PREVIOUS="queuedeventid"/>
1474 </KEYS>
1475 </TABLE>
521d54ec 1476 <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="events_queue_handlers" NEXT="grade_outcomes_courses">
d3f31bf2 1477 <FIELDS>
74c288a1 1478 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" COMMENT="id of the table" NEXT="courseid"/>
1479 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="Mostly these are defined site wide ie NULL" PREVIOUS="id" NEXT="shortname"/>
1480 <FIELD NAME="shortname" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="The short name or code for this outcome statement" PREVIOUS="courseid" NEXT="fullname"/>
1481 <FIELD NAME="fullname" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" COMMENT="The full description of the outcome (usually 1 sentence)" PREVIOUS="shortname" NEXT="scaleid"/>
1482 <FIELD NAME="scaleid" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="The recommended scale for this outcome." PREVIOUS="fullname" NEXT="description"/>
8bdc9cac
SH
1483 <FIELD NAME="description" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" COMMENT="outcome description" PREVIOUS="scaleid" NEXT="descriptionformat"/>
1484 <FIELD NAME="descriptionformat" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="description" NEXT="timecreated"/>
1485 <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="the time this outcome was first created" PREVIOUS="descriptionformat" NEXT="timemodified"/>
74c288a1 1486 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="the time this outcome was last updated" PREVIOUS="timecreated" NEXT="usermodified"/>
1487 <FIELD NAME="usermodified" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="the userid of the person who last modified this outcome" PREVIOUS="timemodified"/>
d3f31bf2 1488 </FIELDS>
1489 <KEYS>
7529139a 1490 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="courseid"/>
d3f31bf2 1491 <KEY NAME="courseid" TYPE="foreign" FIELDS="courseid" REFTABLE="course" REFFIELDS="id" PREVIOUS="primary" NEXT="scaleid"/>
1492 <KEY NAME="scaleid" TYPE="foreign" FIELDS="scaleid" REFTABLE="scale" REFFIELDS="id" PREVIOUS="courseid" NEXT="usermodified"/>
1f496ded 1493 <KEY NAME="usermodified" TYPE="foreign" FIELDS="usermodified" REFTABLE="user" REFFIELDS="id" PREVIOUS="scaleid" NEXT="courseid-shortname"/>
7529139a 1494 <KEY NAME="courseid-shortname" TYPE="unique" FIELDS="courseid, shortname" PREVIOUS="usermodified"/>
d3f31bf2 1495 </KEYS>
1496 </TABLE>
521d54ec 1497 <TABLE NAME="grade_outcomes_courses" COMMENT="stores what outcomes are used in what courses." PREVIOUS="grade_outcomes" NEXT="grade_categories">
1498 <FIELDS>
74c288a1 1499 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="courseid"/>
1500 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="id of the course" PREVIOUS="id" NEXT="outcomeid"/>
1501 <FIELD NAME="outcomeid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="id of the outcome" PREVIOUS="courseid"/>
521d54ec 1502 </FIELDS>
1503 <KEYS>
7529139a 1504 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="courseid"/>
521d54ec 1505 <KEY NAME="courseid" TYPE="foreign" FIELDS="courseid" REFTABLE="course" REFFIELDS="id" PREVIOUS="primary" NEXT="outcomeid"/>
1506 <KEY NAME="outcomeid" TYPE="foreign" FIELDS="outcomeid" REFTABLE="grade_outcomes" REFFIELDS="id" PREVIOUS="courseid" NEXT="courseid-outcomeid"/>
1507 <KEY NAME="courseid-outcomeid" TYPE="unique" FIELDS="courseid, outcomeid" PREVIOUS="outcomeid"/>
1508 </KEYS>
1509 </TABLE>
1510 <TABLE NAME="grade_categories" COMMENT="This table keeps information about categories, used for grouping items." PREVIOUS="grade_outcomes_courses" NEXT="grade_items">
d3f31bf2 1511 <FIELDS>
74c288a1 1512 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="courseid"/>
1513 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="The course this grade category is part of" PREVIOUS="id" NEXT="parent"/>
1514 <FIELD NAME="parent" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="Categories can be hierarchical" PREVIOUS="courseid" NEXT="depth"/>
1515 <FIELD NAME="depth" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="How many parents does this category have?" PREVIOUS="parent" NEXT="path"/>
1516 <FIELD NAME="path" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" COMMENT="shows the path as /1/2/3 (like course_categories)" PREVIOUS="depth" NEXT="fullname"/>
1517 <FIELD NAME="fullname" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="The name of this grade category" PREVIOUS="path" NEXT="aggregation"/>
1518 <FIELD NAME="aggregation" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" COMMENT="A constant pointing to one of the predefined aggregation strategies (none, mean,median,sum, etc)" PREVIOUS="fullname" NEXT="keephigh"/>
1519 <FIELD NAME="keephigh" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" COMMENT="Keep only the X highest items" PREVIOUS="aggregation" NEXT="droplow"/>
1520 <FIELD NAME="droplow" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" COMMENT="Drop the X lowest items" PREVIOUS="keephigh" NEXT="aggregateonlygraded"/>
1521 <FIELD NAME="aggregateonlygraded" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="aggregate only graded activities" PREVIOUS="droplow" NEXT="aggregateoutcomes"/>
1522 <FIELD NAME="aggregateoutcomes" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Aggregate outcomes" PREVIOUS="aggregateonlygraded" NEXT="aggregatesubcats"/>
1523 <FIELD NAME="aggregatesubcats" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="ignore subcategories in aggregation" PREVIOUS="aggregateoutcomes" NEXT="timecreated"/>
1524 <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="aggregatesubcats" NEXT="timemodified"/>
1525 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="timecreated"/>
d3f31bf2 1526 </FIELDS>
1527 <KEYS>
7529139a 1528 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="courseid"/>
d3f31bf2 1529 <KEY NAME="courseid" TYPE="foreign" FIELDS="courseid" REFTABLE="course" REFFIELDS="id" PREVIOUS="primary" NEXT="parent"/>
1530 <KEY NAME="parent" TYPE="foreign" FIELDS="parent" REFTABLE="grade_categories" REFFIELDS="id" PREVIOUS="courseid"/>
1531 </KEYS>
1532 </TABLE>
1533 <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="grade_categories" NEXT="grade_grades">
5cb564aa 1534 <FIELDS>
74c288a1 1535 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="courseid"/>
1536 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="The course this item is part of" PREVIOUS="id" NEXT="categoryid"/>
1537 <FIELD NAME="categoryid" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="(optional) the category group this item belongs to" PREVIOUS="courseid" NEXT="itemname"/>
1538 <FIELD NAME="itemname" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" COMMENT="The name of this item (pushed in by the module)" PREVIOUS="categoryid" NEXT="itemtype"/>
1539 <FIELD NAME="itemtype" TYPE="char" LENGTH="30" NOTNULL="true" SEQUENCE="false" COMMENT="'mod', 'blocks', 'import', 'calculated' etc" PREVIOUS="itemname" NEXT="itemmodule"/>
1540 <FIELD NAME="itemmodule" TYPE="char" LENGTH="30" NOTNULL="false" SEQUENCE="false" COMMENT="'forum', 'quiz', 'csv', etc" PREVIOUS="itemtype" NEXT="iteminstance"/>
1541 <FIELD NAME="iteminstance" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="id of the item module" PREVIOUS="itemmodule" NEXT="itemnumber"/>
1542 <FIELD NAME="itemnumber" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="Can be used to distinguish multiple grades for an activity" PREVIOUS="iteminstance" NEXT="iteminfo"/>
1543 <FIELD NAME="iteminfo" TYPE="text" LENGTH="medium" NOTNULL="false" SEQUENCE="false" COMMENT="Info and notes about this item XXX" PREVIOUS="itemnumber" NEXT="idnumber"/>
1544 <FIELD NAME="idnumber" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" COMMENT="Arbitrary idnumber provided by the module responsible" PREVIOUS="iteminfo" NEXT="calculation"/>
1545 <FIELD NAME="calculation" TYPE="text" LENGTH="medium" NOTNULL="false" SEQUENCE="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"/>
1546 <FIELD NAME="gradetype" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="false" DEFAULT="1" SEQUENCE="false" COMMENT="0 = none, 1 = value, 2 = scale, 3 = text" PREVIOUS="calculation" NEXT="grademax"/>
1547 <FIELD NAME="grademax" TYPE="number" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="100" SEQUENCE="false" DECIMALS="5" COMMENT="What is the maximum allowable grade?" PREVIOUS="gradetype" NEXT="grademin"/>
1548 <FIELD NAME="grademin" TYPE="number" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" DECIMALS="5" COMMENT="What is the minimum allowable grade?" PREVIOUS="grademax" NEXT="scaleid"/>
1549 <FIELD NAME="scaleid" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="If this grade is based on a scale, which one is it?" PREVIOUS="grademin" NEXT="outcomeid"/>
1550 <FIELD NAME="outcomeid" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="If this grade is related to an outcome, which one is it?" PREVIOUS="scaleid" NEXT="gradepass"/>
1551 <FIELD NAME="gradepass" TYPE="number" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" DECIMALS="5" COMMENT="What grade is needed to pass? grademin &amp;lt; gradepass &amp;lt;= grademax" PREVIOUS="outcomeid" NEXT="multfactor"/>
1552 <FIELD NAME="multfactor" TYPE="number" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="1.0" SEQUENCE="false" DECIMALS="5" COMMENT="Multiply all grades by this" PREVIOUS="gradepass" NEXT="plusfactor"/>
1553 <FIELD NAME="plusfactor" TYPE="number" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" DECIMALS="5" COMMENT="Add this to all grades" PREVIOUS="multfactor" NEXT="aggregationcoef"/>
1554 <FIELD NAME="aggregationcoef" TYPE="number" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" DECIMALS="5" COMMENT="Aggregation coefficient used for category weights or other aggregation types" PREVIOUS="plusfactor" NEXT="sortorder"/>
1555 <FIELD NAME="sortorder" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" COMMENT="Sorting order of the columns" PREVIOUS="aggregationcoef" NEXT="display"/>
1556 <FIELD NAME="display" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" COMMENT="Display as real grades, percentages (in reference to the minimum and maximum grades) or letters (A, B, C etc..), or course default (0)" PREVIOUS="sortorder" NEXT="decimals"/>
1557 <FIELD NAME="decimals" TYPE="int" LENGTH="1" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="Also known as precision, the number of digits after the decimal point symbol." PREVIOUS="display" NEXT="hidden"/>
1558 <FIELD NAME="hidden" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" COMMENT="1 is hidden, &amp;gt; 1 is a date to hide until (prevents viewing)" PREVIOUS="decimals" NEXT="locked"/>
1559 <FIELD NAME="locked" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" COMMENT="1 is locked, &amp;gt; 1 is a date to lock until (prevents update)" PREVIOUS="hidden" NEXT="locktime"/>
1560 <FIELD NAME="locktime" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="lock all final grades after this date" PREVIOUS="locked" NEXT="needsupdate"/>
1561 <FIELD NAME="needsupdate" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" COMMENT="If this flag is set, then the whole column will be recalculated" PREVIOUS="locktime" NEXT="timecreated"/>
1562 <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="The first time this grade_item was created" PREVIOUS="needsupdate" NEXT="timemodified"/>
1563 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="The last time this grade_item was modified" PREVIOUS="timecreated"/>
5cb564aa 1564 </FIELDS>
1565 <KEYS>
7529139a 1566 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="courseid"/>
5cb564aa 1567 <KEY NAME="courseid" TYPE="foreign" FIELDS="courseid" REFTABLE="course" REFFIELDS="id" PREVIOUS="primary" NEXT="categoryid"/>
1568 <KEY NAME="categoryid" TYPE="foreign" FIELDS="categoryid" REFTABLE="grade_categories" REFFIELDS="id" PREVIOUS="courseid" NEXT="scaleid"/>
1569 <KEY NAME="scaleid" TYPE="foreign" FIELDS="scaleid" REFTABLE="scale" REFFIELDS="id" PREVIOUS="categoryid" NEXT="outcomeid"/>
1570 <KEY NAME="outcomeid" TYPE="foreign" FIELDS="outcomeid" REFTABLE="grade_outcomes" REFFIELDS="id" PREVIOUS="scaleid"/>
1571 </KEYS>
173403cf 1572 <INDEXES>
6c9f6725 1573 <INDEX NAME="locked-locktime" UNIQUE="false" FIELDS="locked, locktime" COMMENT="used in grading cron" NEXT="itemtype-needsupdate"/>
1574 <INDEX NAME="itemtype-needsupdate" UNIQUE="false" FIELDS="itemtype, needsupdate" COMMENT="used in grading cron" PREVIOUS="locked-locktime" NEXT="gradetype"/>
4a039315 1575 <INDEX NAME="gradetype" UNIQUE="false" FIELDS="gradetype" COMMENT="index for gradetype" PREVIOUS="itemtype-needsupdate" NEXT="idnumber-courseid"/>
1576 <INDEX NAME="idnumber-courseid" UNIQUE="false" FIELDS="idnumber, courseid" COMMENT="non unique index (although programatically we are guarantying some sort of uniqueness both under this table and the course_modules one). TODO: We need a central store of module idnumbers in the future." PREVIOUS="gradetype"/>
173403cf 1577 </INDEXES>
5cb564aa 1578 </TABLE>
3f2b0c8a 1579 <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_items" NEXT="grade_outcomes_history">
5cb564aa 1580 <FIELDS>
74c288a1 1581 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="itemid"/>
1582 <FIELD NAME="itemid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="The item this grade belongs to" PREVIOUS="id" NEXT="userid"/>
1583 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="The user who this grade is for" PREVIOUS="itemid" NEXT="rawgrade"/>
1584 <FIELD NAME="rawgrade" TYPE="number" LENGTH="10" NOTNULL="false" UNSIGNED="false" SEQUENCE="false" DECIMALS="5" COMMENT="If the grade is a float value (or has been converted to one)" PREVIOUS="userid" NEXT="rawgrademax"/>
1585 <FIELD NAME="rawgrademax" TYPE="number" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="100" SEQUENCE="false" DECIMALS="5" COMMENT="The maximum allowable grade when this was created" PREVIOUS="rawgrade" NEXT="rawgrademin"/>
1586 <FIELD NAME="rawgrademin" TYPE="number" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" DECIMALS="5" COMMENT="The minimum allowable grade when this was created" PREVIOUS="rawgrademax" NEXT="rawscaleid"/>
1587 <FIELD NAME="rawscaleid" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="If this grade is based on a scale, which one was it?" PREVIOUS="rawgrademin" NEXT="usermodified"/>
1588 <FIELD NAME="usermodified" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="the userid of the person who last modified this grade" PREVIOUS="rawscaleid" NEXT="finalgrade"/>
1589 <FIELD NAME="finalgrade" TYPE="number" LENGTH="10" NOTNULL="false" UNSIGNED="false" SEQUENCE="false" DECIMALS="5" COMMENT="The final grade (cached) after all calculations are made" PREVIOUS="usermodified" NEXT="hidden"/>
1590 <FIELD NAME="hidden" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="show 0, hide 1 or hide until date" PREVIOUS="finalgrade" NEXT="locked"/>
1591 <FIELD NAME="locked" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="not locked 0, locked from date" PREVIOUS="hidden" NEXT="locktime"/>
1592 <FIELD NAME="locktime" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="automatic locking of final grade, 0 means none, date otherwise" PREVIOUS="locked" NEXT="exported"/>
1593 <FIELD NAME="exported" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="date of last grade export, 0 if none" PREVIOUS="locktime" NEXT="overridden"/>
1594 <FIELD NAME="overridden" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="indicates grade overridden from gradebook, 0 means none, date means overridden" PREVIOUS="exported" NEXT="excluded"/>
1595 <FIELD NAME="excluded" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="grade excluded from aggregation functions, date means when excluded" PREVIOUS="overridden" NEXT="feedback"/>
1596 <FIELD NAME="feedback" TYPE="text" LENGTH="medium" NOTNULL="false" SEQUENCE="false" COMMENT="grading feedback" PREVIOUS="excluded" NEXT="feedbackformat"/>
1597 <FIELD NAME="feedbackformat" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="format of feedback text" PREVIOUS="feedback" NEXT="information"/>
1598 <FIELD NAME="information" TYPE="text" LENGTH="medium" NOTNULL="false" SEQUENCE="false" COMMENT="optiona information" PREVIOUS="feedbackformat" NEXT="informationformat"/>
1599 <FIELD NAME="informationformat" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="format of information text" PREVIOUS="information" NEXT="timecreated"/>
1600 <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="the time this grade was first created" PREVIOUS="informationformat" NEXT="timemodified"/>
1601 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="the time this grade was last modified" PREVIOUS="timecreated"/>
5cb564aa 1602 </FIELDS>
1603 <KEYS>
7529139a 1604 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="itemid"/>
5cb564aa 1605 <KEY NAME="itemid" TYPE="foreign" FIELDS="itemid" REFTABLE="grade_items" REFFIELDS="id" PREVIOUS="primary" NEXT="userid"/>
ac9b0805 1606 <KEY NAME="userid" TYPE="foreign" FIELDS="userid" REFTABLE="user" REFFIELDS="id" PREVIOUS="itemid" NEXT="rawscaleid"/>
1607 <KEY NAME="rawscaleid" TYPE="foreign" FIELDS="rawscaleid" REFTABLE="scale" REFFIELDS="id" PREVIOUS="userid" NEXT="usermodified"/>
1dda50ea 1608 <KEY NAME="usermodified" TYPE="foreign" FIELDS="usermodified" REFTABLE="user" REFFIELDS="id" PREVIOUS="rawscaleid" NEXT="userid-itemid"/>
1609 <KEY NAME="userid-itemid" TYPE="unique" FIELDS="userid, itemid" COMMENT="one entry per user per item" PREVIOUS="usermodified"/>
5cb564aa 1610 </KEYS>
173403cf 1611 <INDEXES>
6c9f6725 1612 <INDEX NAME="locked-locktime" UNIQUE="false" FIELDS="locked, locktime" COMMENT="used in grading cron"/>
173403cf 1613 </INDEXES>
5cb564aa 1614 </TABLE>
3f2b0c8a 1615 <TABLE NAME="grade_outcomes_history" COMMENT="History table" PREVIOUS="grade_grades" NEXT="grade_categories_history">
5cb564aa 1616 <FIELDS>
74c288a1 1617 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="action"/>
1618 <FIELD NAME="action" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="created/modified/deleted constants" PREVIOUS="id" NEXT="oldid"/>
1619 <FIELD NAME="oldid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="action" NEXT="source"/>
1620 <FIELD NAME="source" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" COMMENT="What caused the modification? manual/module/import/..." PREVIOUS="oldid" NEXT="timemodified"/>
1621 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="The last time this grade_item was modified" PREVIOUS="source" NEXT="loggeduser"/>
1622 <FIELD NAME="loggeduser" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="the userid of the person who last modified this outcome" PREVIOUS="timemodified" NEXT="courseid"/>
1623 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="Mostly these are defined site wide ie NULL" PREVIOUS="loggeduser" NEXT="shortname"/>
1624 <FIELD NAME="shortname" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="The short name or code for this outcome statement" PREVIOUS="courseid" NEXT="fullname"/>
1625 <FIELD NAME="fullname" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" COMMENT="The full description of the outcome (usually 1 sentence)" PREVIOUS="shortname" NEXT="scaleid"/>
1626 <FIELD NAME="scaleid" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="The recommended scale for this outcome." PREVIOUS="fullname" NEXT="description"/>
1627 <FIELD NAME="description" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" COMMENT="Outcome description" PREVIOUS="scaleid"/>
5cb564aa 1628 </FIELDS>
1629 <KEYS>
7529139a 1630 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="oldid"/>
d3f31bf2 1631 <KEY NAME="oldid" TYPE="foreign" FIELDS="oldid" REFTABLE="grade_outcomes" REFFIELDS="id" PREVIOUS="primary" NEXT="courseid"/>
1632 <KEY NAME="courseid" TYPE="foreign" FIELDS="courseid" REFTABLE="course" REFFIELDS="id" PREVIOUS="oldid" NEXT="scaleid"/>
1633 <KEY NAME="scaleid" TYPE="foreign" FIELDS="scaleid" REFTABLE="scale" REFFIELDS="id" PREVIOUS="courseid" NEXT="loggeduser"/>
1634 <KEY NAME="loggeduser" TYPE="foreign" FIELDS="loggeduser" REFTABLE="user" REFFIELDS="id" PREVIOUS="scaleid"/>
5cb564aa 1635 </KEYS>
d3f31bf2 1636 <INDEXES>
1637 <INDEX NAME="action" UNIQUE="false" FIELDS="action" COMMENT="insert/update/delete"/>
1638 </INDEXES>
5cb564aa 1639 </TABLE>
d3f31bf2 1640 <TABLE NAME="grade_categories_history" COMMENT="History of grade_categories" PREVIOUS="grade_outcomes_history" NEXT="grade_items_history">
1641 <FIELDS>
74c288a1 1642 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="action"/>
1643 <FIELD NAME="action" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="created/modified/deleted constants" PREVIOUS="id" NEXT="oldid"/>
1644 <FIELD NAME="oldid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="action" NEXT="source"/>
1645 <FIELD NAME="source" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" COMMENT="What caused the modification? manual/module/import/..." PREVIOUS="oldid" NEXT="timemodified"/>
1646 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="The last time this grade_item was modified" PREVIOUS="source" NEXT="loggeduser"/>
1647 <FIELD NAME="loggeduser" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="the userid of the person who last modified this outcome" PREVIOUS="timemodified" NEXT="courseid"/>
1648 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="The course this grade category is part of" PREVIOUS="loggeduser" NEXT="parent"/>
1649 <FIELD NAME="parent" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="Categories can be hierarchical" PREVIOUS="courseid" NEXT="depth"/>
1650 <FIELD NAME="depth" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="How many parents does this category have?" PREVIOUS="parent" NEXT="path"/>
1651 <FIELD NAME="path" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" COMMENT="shows the path as /1/2/3 (like course_categories)" PREVIOUS="depth" NEXT="fullname"/>
1652 <FIELD NAME="fullname" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="The name of this grade category" PREVIOUS="path" NEXT="aggregation"/>
1653 <FIELD NAME="aggregation" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" COMMENT="A constant pointing to one of the predefined aggregation strategies (none, mean,median,sum, etc)" PREVIOUS="fullname" NEXT="keephigh"/>
1654 <FIELD NAME="keephigh" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" COMMENT="Keep only the X highest items" PREVIOUS="aggregation" NEXT="droplow"/>
1655 <FIELD NAME="droplow" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" COMMENT="Drop the X lowest items" PREVIOUS="keephigh" NEXT="aggregateonlygraded"/>
1656 <FIELD NAME="aggregateonlygraded" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="aggregate only graded items" PREVIOUS="droplow" NEXT="aggregateoutcomes"/>
1657 <FIELD NAME="aggregateoutcomes" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Aggregate outcomes" PREVIOUS="aggregateonlygraded" NEXT="aggregatesubcats"/>
1658 <FIELD NAME="aggregatesubcats" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="ignore subcategories in aggregation" PREVIOUS="aggregateoutcomes"/>
d3f31bf2 1659 </FIELDS>
1660 <KEYS>
7529139a 1661 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="oldid"/>
d3f31bf2 1662 <KEY NAME="oldid" TYPE="foreign" FIELDS="oldid" REFTABLE="grade_categories" REFFIELDS="id" PREVIOUS="primary" NEXT="courseid"/>
1663 <KEY NAME="courseid" TYPE="foreign" FIELDS="courseid" REFTABLE="course" REFFIELDS="id" PREVIOUS="oldid" NEXT="parent"/>
1664 <KEY NAME="parent" TYPE="foreign" FIELDS="parent" REFTABLE="grade_categories" REFFIELDS="id" PREVIOUS="courseid" NEXT="loggeduser"/>
1665 <KEY NAME="loggeduser" TYPE="foreign" FIELDS="loggeduser" REFTABLE="user" REFFIELDS="id" PREVIOUS="parent"/>
1666 </KEYS>
1667 <INDEXES>
1668 <INDEX NAME="action" UNIQUE="false" FIELDS="action" COMMENT="insert/update/delete"/>
1669 </INDEXES>
1670 </TABLE>
1671 <TABLE NAME="grade_items_history" COMMENT="History of grade_items" PREVIOUS="grade_categories_history" NEXT="grade_grades_history">
5cb564aa 1672 <FIELDS>
74c288a1 1673 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="action"/>
1674 <FIELD NAME="action" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="created/modified/deleted constants" PREVIOUS="id" NEXT="oldid"/>
1675 <FIELD NAME="oldid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="action" NEXT="source"/>
1676 <FIELD NAME="source" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" COMMENT="What caused the modification? manual/module/import/..." PREVIOUS="oldid" NEXT="timemodified"/>
1677 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="The last time this grade_item was modified" PREVIOUS="source" NEXT="loggeduser"/>
1678 <FIELD NAME="loggeduser" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="the userid of the person who last modified this outcome" PREVIOUS="timemodified" NEXT="courseid"/>
1679 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="The course this item is part of" PREVIOUS="loggeduser" NEXT="categoryid"/>
1680 <FIELD NAME="categoryid" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="(optional) the category group this item belongs to" PREVIOUS="courseid" NEXT="itemname"/>
1681 <FIELD NAME="itemname" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" COMMENT="The name of this item (pushed in by the module)" PREVIOUS="categoryid" NEXT="itemtype"/>
1682 <FIELD NAME="itemtype" TYPE="char" LENGTH="30" NOTNULL="true" SEQUENCE="false" COMMENT="'mod', 'blocks', 'import', 'calculated' etc" PREVIOUS="itemname" NEXT="itemmodule"/>
1683 <FIELD NAME="itemmodule" TYPE="char" LENGTH="30" NOTNULL="false" SEQUENCE="false" COMMENT="'forum', 'quiz', 'csv', etc" PREVIOUS="itemtype" NEXT="iteminstance"/>
1684 <FIELD NAME="iteminstance" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="id of the item module" PREVIOUS="itemmodule" NEXT="itemnumber"/>
1685 <FIELD NAME="itemnumber" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="Can be used to distinguish multiple grades for an activity" PREVIOUS="iteminstance" NEXT="iteminfo"/>
1686 <FIELD NAME="iteminfo" TYPE="text" LENGTH="medium" NOTNULL="false" SEQUENCE="false" COMMENT="Info and notes about this item XXX" PREVIOUS="itemnumber" NEXT="idnumber"/>
1687 <FIELD NAME="idnumber" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" COMMENT="Arbitrary idnumber provided by the module responsible" PREVIOUS="iteminfo" NEXT="calculation"/>
1688 <FIELD NAME="calculation" TYPE="text" LENGTH="medium" NOTNULL="false" SEQUENCE="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"/>
1689 <FIELD NAME="gradetype" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="false" DEFAULT="1" SEQUENCE="false" COMMENT="0 = none, 1 = value, 2 = scale, 3 = text" PREVIOUS="calculation" NEXT="grademax"/>
1690 <FIELD NAME="grademax" TYPE="number" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="100" SEQUENCE="false" DECIMALS="5" COMMENT="What is the maximum allowable grade?" PREVIOUS="gradetype" NEXT="grademin"/>
1691 <FIELD NAME="grademin" TYPE="number" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" DECIMALS="5" COMMENT="What is the minimum allowable grade?" PREVIOUS="grademax" NEXT="scaleid"/>
1692 <FIELD NAME="scaleid" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="If this grade is based on a scale, which one is it?" PREVIOUS="grademin" NEXT="outcomeid"/>
1693 <FIELD NAME="outcomeid" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="If this grade is related to an outcome, which one is it?" PREVIOUS="scaleid" NEXT="gradepass"/>
1694 <FIELD NAME="gradepass" TYPE="number" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" DECIMALS="5" COMMENT="What grade is needed to pass? grademin &amp;lt; gradepass &amp;lt;= grademax" PREVIOUS="outcomeid" NEXT="multfactor"/>
1695 <FIELD NAME="multfactor" TYPE="number" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="1.0" SEQUENCE="false" DECIMALS="5" COMMENT="Multiply all grades by this" PREVIOUS="gradepass" NEXT="plusfactor"/>
1696 <FIELD NAME="plusfactor" TYPE="number" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" DECIMALS="5" COMMENT="Add this to all grades" PREVIOUS="multfactor" NEXT="aggregationcoef"/>
1697 <FIELD NAME="aggregationcoef" TYPE="number" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" DECIMALS="5" COMMENT="Aggregation coefficient used for category weights or other aggregation types" PREVIOUS="plusfactor" NEXT="sortorder"/>
1698 <FIELD NAME="sortorder" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" COMMENT="Sorting order of the columns" PREVIOUS="aggregationcoef" NEXT="hidden"/>
1699 <FIELD NAME="hidden" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" COMMENT="1 is hidden, &amp;gt; 1 is a date to hide until (prevents viewing)" PREVIOUS="sortorder" NEXT="locked"/>
1700 <FIELD NAME="locked" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" COMMENT="1 is locked, &amp;gt; 1 is a date to lock until (prevents update)" PREVIOUS="hidden" NEXT="locktime"/>
1701 <FIELD NAME="locktime" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="lock all final grades after this date" PREVIOUS="locked" NEXT="needsupdate"/>
1702 <FIELD NAME="needsupdate" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" COMMENT="If this flag is set, then the whole column will be recalculated" PREVIOUS="locktime"/>
5cb564aa 1703 </FIELDS>
1704 <KEYS>
7529139a 1705 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="oldid"/>
aaff71da 1706 <KEY NAME="oldid" TYPE="foreign" FIELDS="oldid" REFTABLE="grade_items" REFFIELDS="id" PREVIOUS="primary" NEXT="courseid"/>
1707 <KEY NAME="courseid" TYPE="foreign" FIELDS="courseid" REFTABLE="course" REFFIELDS="id" PREVIOUS="oldid" NEXT="categoryid"/>
1708 <KEY NAME="categoryid" TYPE="foreign" FIELDS="categoryid" REFTABLE="grade_categories" REFFIELDS="id" PREVIOUS="courseid" NEXT="scaleid"/>
1709 <KEY NAME="scaleid" TYPE="foreign" FIELDS="scaleid" REFTABLE="scale" REFFIELDS="id" PREVIOUS="categoryid" NEXT="outcomeid"/>
bc7afe29 1710 <KEY NAME="outcomeid" TYPE="foreign" FIELDS="outcomeid" REFTABLE="grade_outcomes" REFFIELDS="id" PREVIOUS="scaleid" NEXT="loggeduser"/>
1711 <KEY NAME="loggeduser" TYPE="foreign" FIELDS="loggeduser" REFTABLE="user" REFFIELDS="id" PREVIOUS="outcomeid"/>
aaff71da 1712 </KEYS>
1713 <INDEXES>
1714 <INDEX NAME="action" UNIQUE="false" FIELDS="action" COMMENT="insert/update/delete"/>
1715 </INDEXES>
1716 </TABLE>
3f2b0c8a 1717 <TABLE NAME="grade_grades_history" COMMENT="History table" PREVIOUS="grade_items_history" NEXT="grade_import_newitem">
aaff71da 1718 <FIELDS>
74c288a1 1719 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="action"/>
1720 <FIELD NAME="action" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="created/modified/deleted constants" PREVIOUS="id" NEXT="oldid"/>
1721 <FIELD NAME="oldid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="action" NEXT="source"/>
1722 <FIELD NAME="source" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" COMMENT="What caused the modification? manual/module/import/..." PREVIOUS="oldid" NEXT="timemodified"/>
1723 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="The last time this grade_item was modified" PREVIOUS="source" NEXT="loggeduser"/>
1724 <FIELD NAME="loggeduser" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="the userid of the person who last modified this outcome" PREVIOUS="timemodified" NEXT="itemid"/>
1725 <FIELD NAME="itemid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="The item this grade belongs to" PREVIOUS="loggeduser" NEXT="userid"/>
1726 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="The user who this grade is for" PREVIOUS="itemid" NEXT="rawgrade"/>
1727 <FIELD NAME="rawgrade" TYPE="number" LENGTH="10" NOTNULL="false" UNSIGNED="false" SEQUENCE="false" DECIMALS="5" COMMENT="If the grade is a float value (or has been converted to one)" PREVIOUS="userid" NEXT="rawgrademax"/>
1728 <FIELD NAME="rawgrademax" TYPE="number" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="100" SEQUENCE="false" DECIMALS="5" COMMENT="The maximum allowable grade when this was created" PREVIOUS="rawgrade" NEXT="rawgrademin"/>
1729 <FIELD NAME="rawgrademin" TYPE="number" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" DECIMALS="5" COMMENT="The minimum allowable grade when this was created" PREVIOUS="rawgrademax" NEXT="rawscaleid"/>
1730 <FIELD NAME="rawscaleid" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="If this grade is based on a scale, which one was it?" PREVIOUS="rawgrademin" NEXT="usermodified"/>
1731 <FIELD NAME="usermodified" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="the userid of the person who last modified this grade" PREVIOUS="rawscaleid" NEXT="finalgrade"/>
1732 <FIELD NAME="finalgrade" TYPE="number" LENGTH="10" NOTNULL="false" UNSIGNED="false" SEQUENCE="false" DECIMALS="5" COMMENT="The final grade (cached) after all calculations are made" PREVIOUS="usermodified" NEXT="hidden"/>
1733 <FIELD NAME="hidden" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="show 0, hide 1 or hide until date" PREVIOUS="finalgrade" NEXT="locked"/>
1734 <FIELD NAME="locked" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="not locked 0, locked from date" PREVIOUS="hidden" NEXT="locktime"/>
1735 <FIELD NAME="locktime" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="automatic locking of final grade, 0 means none, date otherwise" PREVIOUS="locked" NEXT="exported"/>
1736 <FIELD NAME="exported" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="date of last grade export, 0 if none" PREVIOUS="locktime" NEXT="overridden"/>
1737 <FIELD NAME="overridden" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="indicates grade overridden from gradebook, 0 means none, date means overridden" PREVIOUS="exported" NEXT="excluded"/>
1738 <FIELD NAME="excluded" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="grade excluded from aggregation functions, date means when excluded" PREVIOUS="overridden" NEXT="feedback"/>
1739 <FIELD NAME="feedback" TYPE="text" LENGTH="medium" NOTNULL="false" SEQUENCE="false" COMMENT="grading feedback" PREVIOUS="excluded" NEXT="feedbackformat"/>
1740 <FIELD NAME="feedbackformat" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="format of feedback text" PREVIOUS="feedback" NEXT="information"/>
1741 <FIELD NAME="information" TYPE="text" LENGTH="medium" NOTNULL="false" SEQUENCE="false" COMMENT="optiona information" PREVIOUS="feedbackformat" NEXT="informationformat"/>
1742 <FIELD NAME="informationformat" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="format of information text" PREVIOUS="information"/>
aaff71da 1743 </FIELDS>
1744 <KEYS>
7529139a 1745 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="oldid"/>
aaff71da 1746 <KEY NAME="oldid" TYPE="foreign" FIELDS="oldid" REFTABLE="grade_grades" REFFIELDS="id" PREVIOUS="primary" NEXT="itemid"/>
1747 <KEY NAME="itemid" TYPE="foreign" FIELDS="itemid" REFTABLE="grade_items" REFFIELDS="id" PREVIOUS="oldid" NEXT="userid"/>
1748 <KEY NAME="userid" TYPE="foreign" FIELDS="userid" REFTABLE="user" REFFIELDS="id" PREVIOUS="itemid" NEXT="rawscaleid"/>
1749 <KEY NAME="rawscaleid" TYPE="foreign" FIELDS="rawscaleid" REFTABLE="scale" REFFIELDS="id" PREVIOUS="userid" NEXT="usermodified"/>
1750 <KEY NAME="usermodified" TYPE="foreign" FIELDS="usermodified" REFTABLE="user" REFFIELDS="id" PREVIOUS="rawscaleid" NEXT="loggeduser"/>
1751 <KEY NAME="loggeduser" TYPE="foreign" FIELDS="loggeduser" REFTABLE="user" REFFIELDS="id" PREVIOUS="usermodified"/>
5cb564aa 1752 </KEYS>
aaff71da 1753 <INDEXES>
1754 <INDEX NAME="action" UNIQUE="false" FIELDS="action" COMMENT="insert/update/delete"/>
1755 </INDEXES>
1756 </TABLE>
3f2b0c8a 1757 <TABLE NAME="grade_import_newitem" COMMENT="temporary table for storing new grade_item names from grade import" PREVIOUS="grade_grades_history" NEXT="grade_import_values">
aaff71da 1758 <FIELDS>
74c288a1 1759 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="itemname"/>
1760 <FIELD NAME="itemname" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="new grade item name" PREVIOUS="id" NEXT="importcode"/>
1761 <FIELD NAME="importcode" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="import batch code for identification" PREVIOUS="itemname" NEXT="importer"/>
1762 <FIELD NAME="importer" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="user importing the data" PREVIOUS="importcode"/>
aaff71da 1763 </FIELDS>
1764 <KEYS>
8108909a 1765 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="importer"/>
1766 <KEY NAME="importer" TYPE="foreign" FIELDS="importer" REFTABLE="user" REFFIELDS="id" PREVIOUS="primary"/>
aaff71da 1767 </KEYS>
5cb564aa 1768 </TABLE>
79642064 1769 <TABLE NAME="grade_import_values" COMMENT="Temporary table for importing grades" PREVIOUS="grade_import_newitem" NEXT="tag">
4d40aa14 1770 <FIELDS>
74c288a1 1771 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="itemid"/>
1772 <FIELD NAME="itemid" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="if set, this points to existing grade_items id" PREVIOUS="id" NEXT="newgradeitem"/>
1773 <FIELD NAME="newgradeitem" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="if set, points to the id of grade_import_newitem" PREVIOUS="itemid" NEXT="userid"/>
1774 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="newgradeitem" NEXT="finalgrade"/>
1775 <FIELD NAME="finalgrade" TYPE="number" LENGTH="10" NOTNULL="false" UNSIGNED="false" SEQUENCE="false" DECIMALS="5" COMMENT="raw grade value" PREVIOUS="userid" NEXT="feedback"/>
1776 <FIELD NAME="feedback" TYPE="text" LENGTH="medium" NOTNULL="false" SEQUENCE="false" PREVIOUS="finalgrade" NEXT="importcode"/>
1777 <FIELD NAME="importcode" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="similar to backup_code, a unique batch code for identifying one batch of imports" PREVIOUS="feedback" NEXT="importer"/>
1778 <FIELD NAME="importer" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" PREVIOUS="importcode"/>
4d40aa14 1779 </FIELDS>
1780 <KEYS>
7529139a 1781 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="itemid"/>
4d40aa14 1782 <KEY NAME="itemid" TYPE="foreign" FIELDS="itemid" REFTABLE="grade_items" REFFIELDS="id" PREVIOUS="primary" NEXT="newgradeitem"/>
8108909a 1783 <KEY NAME="newgradeitem" TYPE="foreign" FIELDS="newgradeitem" REFTABLE="grade_import_newitem" REFFIELDS="id" PREVIOUS="itemid" NEXT="importer"/>
1784 <KEY NAME="importer" TYPE="foreign" FIELDS="importer" REFTABLE="user" REFFIELDS="id" COMMENT="user who is importing" PREVIOUS="newgradeitem"/>
4d40aa14 1785 </KEYS>
1786 </TABLE>
705789bd 1787 <TABLE NAME="tag" COMMENT="Tag table - this generic table will replace the old &quot;tags&quot; table." PREVIOUS="grade_import_values" NEXT="tag_correlation">
79642064 1788 <FIELDS>
74c288a1 1789 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="userid"/>
1790 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="id" NEXT="name"/>
1791 <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="userid" NEXT="rawname"/>
1792 <FIELD NAME="rawname" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="The raw, unnormalised name for the tag as entered by users" PREVIOUS="name" NEXT="tagtype"/>
1793 <FIELD NAME="tagtype" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" PREVIOUS="rawname" NEXT="description"/>
1794 <FIELD NAME="description" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" PREVIOUS="tagtype" NEXT="descriptionformat"/>
1795 <FIELD NAME="descriptionformat" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="description" NEXT="flag"/>
1796 <FIELD NAME="flag" TYPE="int" LENGTH="4" NOTNULL="false" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="a tag can be 'flagged' as inappropriate" PREVIOUS="descriptionformat" NEXT="timemodified"/>
1797 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" PREVIOUS="flag"/>
79642064 1798 </FIELDS>
1799 <KEYS>
28271c72 1800 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="userid"/>
c4956945 1801 <KEY NAME="userid" TYPE="foreign" FIELDS="userid" REFTABLE="user" REFFIELDS="id" PREVIOUS="primary"/>
79642064 1802 </KEYS>
1803 <INDEXES>
1804 <INDEX NAME="name" UNIQUE="true" FIELDS="name" COMMENT="tag names are unique"/>
1805 </INDEXES>
1806 </TABLE>
1807 <TABLE NAME="tag_correlation" COMMENT="The rationale for the 'tag_correlation' table is performance. It works as a cache for a potentially heavy load query done at the 'tag_instance' table. So, the 'tag_correlation' table stores redundant information derived from the 'tag_instance' table" PREVIOUS="tag" NEXT="tag_instance">
1808 <FIELDS>
74c288a1 1809 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="tagid"/>
1810 <FIELD NAME="tagid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="id" NEXT="correlatedtags"/>
1811 <FIELD NAME="correlatedtags" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" PREVIOUS="tagid"/>
79642064 1812 </FIELDS>
1813 <KEYS>
28271c72 1814 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="tagid"/>
c4956945 1815 <KEY NAME="tagid" TYPE="foreign" FIELDS="tagid" REFTABLE="tag" REFFIELDS="id" PREVIOUS="primary"/>
79642064 1816 </KEYS>
79642064 1817 </TABLE>
2524b0f2 1818 <TABLE NAME="tag_instance" COMMENT="tag_instance table holds the information of associations between tags and other items" PREVIOUS="tag_correlation" NEXT="groups">
79642064 1819 <FIELDS>
74c288a1 1820 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="tagid"/>
1821 <FIELD NAME="tagid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="id" NEXT="itemtype"/>
1822 <FIELD NAME="itemtype" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="tagid" NEXT="itemid"/>
1823 <FIELD NAME="itemid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="itemtype" NEXT="tiuserid"/>
1824 <FIELD NAME="tiuserid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="itemid" NEXT="ordering"/>
1825 <FIELD NAME="ordering" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="Maintains the order of the tag instances of an item" PREVIOUS="tiuserid" NEXT="timemodified"/>
1826 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="timemodified" PREVIOUS="ordering"/>
79642064 1827 </FIELDS>
1828 <KEYS>
28271c72 1829 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="tagid"/>
c4956945 1830 <KEY NAME="tagid" TYPE="foreign" FIELDS="tagid" REFTABLE="tag" REFFIELDS="id" PREVIOUS="primary"/>
79642064 1831 </KEYS>
1832 <INDEXES>
38fb8190 1833 <INDEX NAME="itemtype-itemid-tagid-tiuserid" UNIQUE="true" FIELDS="itemtype, itemid, tagid, tiuserid"/>
79642064 1834 </INDEXES>
1835 </TABLE>
2524b0f2 1836 <TABLE NAME="groups" COMMENT="Each record represents a group." PREVIOUS="tag_instance" NEXT="groupings">
1837 <FIELDS>
74c288a1 1838 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="courseid"/>
1839 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="id" NEXT="name"/>
1840 <FIELD NAME="name" TYPE="char" LENGTH="254" NOTNULL="true" SEQUENCE="false" COMMENT="Short human readable unique name for the group." PREVIOUS="courseid" NEXT="description"/>
8bdc9cac
SH
1841 <FIELD NAME="description" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" PREVIOUS="name" NEXT="descriptionformat"/>
1842 <FIELD NAME="descriptionformat" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="description" NEXT="enrolmentkey"/>
1843 <FIELD NAME="enrolmentkey" TYPE="char" LENGTH="50" NOTNULL="false" SEQUENCE="false" PREVIOUS="descriptionformat" NEXT="picture"/>
74c288a1 1844 <FIELD NAME="picture" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="enrolmentkey" NEXT="hidepicture"/>
1845 <FIELD NAME="hidepicture" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="picture" NEXT="timecreated"/>
1846 <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="hidepicture" NEXT="timemodified"/>
1847 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="timecreated"/>
2524b0f2 1848 </FIELDS>
1849 <KEYS>
28271c72 1850 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="courseid"/>
2524b0f2 1851 <KEY NAME="courseid" TYPE="foreign" FIELDS="courseid" REFTABLE="course" REFFIELDS="id" PREVIOUS="primary"/>
1852 </KEYS>
1853 </TABLE>
1854 <TABLE NAME="groupings" COMMENT="A grouping is a collection of groups. WAS: groups_groupings" PREVIOUS="groups" NEXT="groups_members">
1855 <FIELDS>
74c288a1 1856 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="courseid"/>
1857 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="name"/>
1858 <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="Short human readable unique name for group." PREVIOUS="courseid" NEXT="description"/>
8bdc9cac
SH
1859 <FIELD NAME="description" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" PREVIOUS="name" NEXT="descriptionformat"/>
1860 <FIELD NAME="descriptionformat" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="description" NEXT="configdata"/>
1861 <FIELD NAME="configdata" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" COMMENT="extra configuration data - may be used by group IU tools" PREVIOUS="descriptionformat" NEXT="timecreated"/>
74c288a1 1862 <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="configdata" NEXT="timemodified"/>
1863 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="timecreated"/>
2524b0f2 1864 </FIELDS>
1865 <KEYS>
28271c72 1866 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="courseid"/>
2524b0f2 1867 <KEY NAME="courseid" TYPE="foreign" FIELDS="courseid" REFTABLE="course" REFFIELDS="id" PREVIOUS="primary"/>
1868 </KEYS>
1869 </TABLE>
1870 <TABLE NAME="groups_members" COMMENT="Link a user to a group." PREVIOUS="groupings" NEXT="groupings_groups">
1871 <FIELDS>
74c288a1 1872 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="groupid"/>
1873 <FIELD NAME="groupid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="userid"/>
1874 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="groupid" NEXT="timeadded"/>
1875 <FIELD NAME="timeadded" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="userid"/>
2524b0f2 1876 </FIELDS>
1877 <KEYS>
28271c72 1878 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="groupid"/>
2524b0f2 1879 <KEY NAME="groupid" TYPE="foreign" FIELDS="groupid" REFTABLE="groups" REFFIELDS="id" PREVIOUS="primary" NEXT="userid"/>
1880 <KEY NAME="userid" TYPE="foreign" FIELDS="userid" REFTABLE="user" REFFIELDS="id" PREVIOUS="groupid"/>
1881 </KEYS>
1882 </TABLE>
61c6071f 1883 <TABLE NAME="groupings_groups" COMMENT="Link a grouping to a group (note, groups can be in multiple groupings ONLY in a course). WAS: groups_groupings_groups" PREVIOUS="groups_members" NEXT="user_private_key">
2524b0f2 1884 <FIELDS>
74c288a1 1885 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="groupingid"/>
1886 <FIELD NAME="groupingid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="groupid"/>
1887 <FIELD NAME="groupid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="groupingid" NEXT="timeadded"/>
1888 <FIELD NAME="timeadded" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="groupid"/>
2524b0f2 1889 </FIELDS>
1890 <KEYS>
28271c72 1891 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="groupingid"/>
2524b0f2 1892 <KEY NAME="groupingid" TYPE="foreign" FIELDS="groupingid" REFTABLE="groupings" REFFIELDS="id" PREVIOUS="primary" NEXT="groupid"/>
1893 <KEY NAME="groupid" TYPE="foreign" FIELDS="groupid" REFTABLE="groups" REFFIELDS="id" PREVIOUS="groupingid"/>
1894 </KEYS>
1895 </TABLE>
e480c18c 1896 <TABLE NAME="user_private_key" COMMENT="access keys used in cookieless scripts - rss, etc." PREVIOUS="groupings_groups" NEXT="grade_letters">
61c6071f 1897 <FIELDS>
74c288a1 1898 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="script"/>
1899 <FIELD NAME="script" TYPE="char" LENGTH="128" NOTNULL="true" SEQUENCE="false" COMMENT="plugin, module - unique identifier" PREVIOUS="id" NEXT="value"/>
1900 <FIELD NAME="value" TYPE="char" LENGTH="128" NOTNULL="true" SEQUENCE="false" COMMENT="private access key value" PREVIOUS="script" NEXT="userid"/>
1901 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="owner" PREVIOUS="value" NEXT="instance"/>
1902 <FIELD NAME="instance" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="optional instance id" PREVIOUS="userid" NEXT="iprestriction"/>
1903 <FIELD NAME="iprestriction" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" COMMENT="ip restriction" PREVIOUS="instance" NEXT="validuntil"/>
1904 <FIELD NAME="validuntil" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="timestampt - valid until data" PREVIOUS="iprestriction" NEXT="timecreated"/>
1905 <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="created timestamp" PREVIOUS="validuntil"/>
61c6071f 1906 </FIELDS>
1907 <KEYS>
7529139a 1908 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="userid"/>
61c6071f 1909 <KEY NAME="userid" TYPE="foreign" FIELDS="userid" REFTABLE="user" REFFIELDS="id" COMMENT="id from user table" PREVIOUS="primary"/>
1910 </KEYS>
1911 <INDEXES>
1912 <INDEX NAME="script-value" UNIQUE="false" FIELDS="script, value" COMMENT="index used for key validation"/>
1913 </INDEXES>
1914 </TABLE>
e4a5c864 1915 <TABLE NAME="grade_letters" COMMENT="Repository for grade letters, for courses and other moodle entities that use grades." PREVIOUS="user_private_key" NEXT="cache_flags">
e480c18c 1916 <FIELDS>
74c288a1 1917 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="contextid"/>
1918 <FIELD NAME="contextid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="What contextid does this letter apply to (for now these will always be courses, but later...)" PREVIOUS="id" NEXT="lowerboundary"/>
1919 <FIELD NAME="lowerboundary" TYPE="number" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="false" DECIMALS="5" COMMENT="The lower boundary of the letter. Its upper boundary is the lower boundary of the next highest letter, unless there is none above, in which case it's grademax for that grade_item." PREVIOUS="contextid" NEXT="letter"/>
1920 <FIELD NAME="letter" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="The display value of the letter. Can be any character or string of characters (OK, A, 10% etc..)" PREVIOUS="lowerboundary"/>
e480c18c 1921 </FIELDS>
1922 <KEYS>
52cb2e47 1923 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
e480c18c 1924 </KEYS>
284abb09 1925 <INDEXES>
a1f27717 1926 <INDEX NAME="contextid-lowerboundary-letter" UNIQUE="true" FIELDS="contextid, lowerboundary, letter" COMMENT="index used when fetching context letters"/>
284abb09 1927 </INDEXES>
e480c18c 1928 </TABLE>
e0724506 1929 <TABLE NAME="cache_flags" COMMENT="Cache of time-sensitive flags" PREVIOUS="grade_letters" NEXT="grade_settings">
e4a5c864 1930 <FIELDS>
74c288a1 1931 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="flagtype"/>
1932 <FIELD NAME="flagtype" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="id" NEXT="name"/>
1933 <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="flagtype" NEXT="timemodified"/>
1934 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="name" NEXT="value"/>
1935 <FIELD NAME="value" TYPE="text" LENGTH="medium" NOTNULL="true" SEQUENCE="false" PREVIOUS="timemodified" NEXT="expiry"/>
1936 <FIELD NAME="expiry" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="value"/>
e4a5c864 1937 </FIELDS>
1938 <KEYS>
1939 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
1940 </KEYS>
1941 <INDEXES>
c57be126 1942 <INDEX NAME="flagtype" UNIQUE="false" FIELDS="flagtype" NEXT="name"/>
1943 <INDEX NAME="name" UNIQUE="false" FIELDS="name" PREVIOUS="flagtype"/>
e4a5c864 1944 </INDEXES>
1945 </TABLE>
5fdd5693 1946 <TABLE NAME="grade_settings" COMMENT="gradebook settings" PREVIOUS="cache_flags" NEXT="webdav_locks">
e0724506 1947 <FIELDS>
74c288a1 1948 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="courseid"/>
1949 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="id" NEXT="name"/>
1950 <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="courseid" NEXT="value"/>
1951 <FIELD NAME="value" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" PREVIOUS="name"/>
e0724506 1952 </FIELDS>
1953 <KEYS>
1954 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="courseid"/>
1955 <KEY NAME="courseid" TYPE="foreign" FIELDS="courseid" REFTABLE="course" REFFIELDS="id" PREVIOUS="primary"/>
1956 </KEYS>
1957 <INDEXES>
1958 <INDEX NAME="courseid-name" UNIQUE="true" FIELDS="courseid, name"/>
1959 </INDEXES>
1960 </TABLE>
27051e43 1961 <TABLE NAME="webdav_locks" COMMENT="Resource locks for WebDAV users" PREVIOUS="grade_settings" NEXT="portfolio_instance">
156df4ed 1962 <FIELDS>
74c288a1 1963 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="token"/>
1964 <FIELD NAME="token" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="id" NEXT="path"/>
1965 <FIELD NAME="path" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="token" NEXT="expiry"/>
1966 <FIELD NAME="expiry" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="path" NEXT="userid"/>
1967 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="expiry" NEXT="recursive"/>
1968 <FIELD NAME="recursive" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="userid" NEXT="exclusivelock"/>
1969 <FIELD NAME="exclusivelock" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="recursive" NEXT="created"/>
1970 <FIELD NAME="created" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="exclusivelock" NEXT="modified"/>
1971 <FIELD NAME="modified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="created" NEXT="owner"/>
1972 <FIELD NAME="owner" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" PREVIOUS="modified"/>
156df4ed 1973 </FIELDS>
1974 <KEYS>
1975 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="token"/>
1976 <KEY NAME="token" TYPE="unique" FIELDS="token" PREVIOUS="primary"/>
1977 </KEYS>
1978 <INDEXES>
1979 <INDEX NAME="path" UNIQUE="false" FIELDS="path" NEXT="expiry"/>
1980 <INDEX NAME="expiry" UNIQUE="false" FIELDS="expiry" PREVIOUS="path"/>
1981 </INDEXES>
1982 </TABLE>
27051e43 1983 <TABLE NAME="portfolio_instance" COMMENT="base table (not including config data) for instances of portfolio plugins." PREVIOUS="webdav_locks" NEXT="portfolio_instance_config">
ac5efef6 1984 <FIELDS>
74c288a1 1985 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="plugin"/>
1986 <FIELD NAME="plugin" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" COMMENT="fk to plugin" PREVIOUS="id" NEXT="name"/>
1987 <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="name of plugin instance" PREVIOUS="plugin" NEXT="visible"/>
1988 <FIELD NAME="visible" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" COMMENT="whether this instance is visible or not" PREVIOUS="name"/>
98978c2e 1989 </FIELDS>
1990 <KEYS>
1991 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
1992 </KEYS>
1993 </TABLE>
ac5efef6 1994 <TABLE NAME="portfolio_instance_config" COMMENT="config for portfolio plugin instances" PREVIOUS="portfolio_instance" NEXT="portfolio_instance_user">
1995 <FIELDS>
74c288a1 1996 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="instance"/>
1997 <FIELD NAME="instance" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="instance of plugin we're configurating" PREVIOUS="id" NEXT="name"/>
1998 <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="config field" PREVIOUS="instance" NEXT="value"/>
1999 <FIELD NAME="value" TYPE="text" LENGTH="big" NOTNULL="false" SEQUENCE="false" COMMENT="config value" PREVIOUS="name"/>
ac5efef6 2000 </FIELDS>
2001 <KEYS>
e1b9ac3e
PL
2002 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="instancefk"/>
2003 <KEY NAME="instancefk" TYPE="foreign" FIELDS="instance" REFTABLE="portfolio_instance" REFFIELDS="id" COMMENT="fk to plugin instance" PREVIOUS="primary"/>
ac5efef6 2004 </KEYS>
2005 <INDEXES>
2006 <INDEX NAME="name" UNIQUE="false" FIELDS="name" COMMENT="name index"/>
2007 </INDEXES>
2008 </TABLE>
04f35360 2009 <TABLE NAME="portfolio_instance_user" COMMENT="user data for portfolio instances." PREVIOUS="portfolio_instance_config" NEXT="portfolio_log">
ac5efef6 2010 <FIELDS>
74c288a1 2011 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="instance"/>
2012 <FIELD NAME="instance" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="fk to instance table" PREVIOUS="id" NEXT="userid"/>
2013 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="fk to user table" PREVIOUS="instance" NEXT="name"/>
2014 <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="name of config item" PREVIOUS="userid" NEXT="value"/>
2015 <FIELD NAME="value" TYPE="text" LENGTH="big" NOTNULL="false" SEQUENCE="false" COMMENT="value of config item" PREVIOUS="name"/>
ac5efef6 2016 </FIELDS>
2017 <KEYS>
2018 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="instancefk"/>
2019 <KEY NAME="instancefk" TYPE="foreign" FIELDS="instance" REFTABLE="portfolio_instance" REFFIELDS="id" COMMENT="fk to portfolio_instance" PREVIOUS="primary" NEXT="userfk"/>
2020 <KEY NAME="userfk" TYPE="foreign" FIELDS="userid" REFTABLE="user" REFFIELDS="id" COMMENT="fk to user table" PREVIOUS="instancefk"/>
2021 </KEYS>
2022 </TABLE>
04f35360 2023 <TABLE NAME="portfolio_log" COMMENT="log of portfolio transfers (used to later check for duplicates)" PREVIOUS="portfolio_instance_user" NEXT="portfolio_tempdata">
2024 <FIELDS>
74c288a1 2025 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="userid"/>
2026 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="user who exported content" PREVIOUS="id" NEXT="time"/>
2027 <FIELD NAME="time" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="time of transfer (in the case of a queued transfer this is the time the actual transfer ran, not when the user started)" PREVIOUS="userid" NEXT="portfolio"/>
2028 <FIELD NAME="portfolio" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="fk to portfolio_instance" PREVIOUS="time" NEXT="caller_class"/>
2029 <FIELD NAME="caller_class" TYPE="char" LENGTH="150" NOTNULL="true" SEQUENCE="false" COMMENT="the name of the class used to create the transfer" PREVIOUS="portfolio" NEXT="caller_file"/>
2030 <FIELD NAME="caller_file" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="path to file to include where the class definition lives. (relative to dirroot)" PREVIOUS="caller_class" NEXT="caller_sha1"/>
45645bce 2031 <FIELD NAME="caller_sha1" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="sha1 of exported content as far as the caller is concerned (before the portfolio plugin gets a hold of it)" PREVIOUS="caller_file" NEXT="tempdataid"/>
eeb7ccf0
PL
2032 <FIELD NAME="tempdataid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" COMMENT="old id from portfolio_tempdata. This is so that we can gracefully catch a race condition between an external system requesting a file and causing the tempdata to be deleted, before the user gets the &quot;your transfer is requested&quot; page" PREVIOUS="caller_sha1" NEXT="returnurl"/>
2033 <FIELD NAME="returnurl" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="the original &quot;returnurl&quot; of the export - takes us to the moodle page we started from" PREVIOUS="tempdataid" NEXT="continueurl"/>
2034 <FIELD NAME="continueurl" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="the url the external system has set to view the transfer" PREVIOUS="returnurl"/>
04f35360 2035 </FIELDS>
2036 <KEYS>
2037 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="userfk"/>
2038 <KEY NAME="userfk" TYPE="foreign" FIELDS="userid" REFTABLE="user" REFFIELDS="id" COMMENT="fk to user table" PREVIOUS="primary" NEXT="portfoliofk"/>
2039 <KEY NAME="portfoliofk" TYPE="foreign" FIELDS="portfolio" REFTABLE="portfolio_instance" REFFIELDS="id" COMMENT="fk to portfolio_instance" PREVIOUS="userfk"/>
2040 </KEYS>
2041 </TABLE>
84a44985 2042 <TABLE NAME="portfolio_tempdata" COMMENT="stores temporary data for portfolio exports. the id of this table is used for the itemid for the temporary files area. cron can clean up stale records (and associated file data) after expirytime." PREVIOUS="portfolio_log" NEXT="message_providers">
04f35360 2043 <FIELDS>
74c288a1 2044 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="data"/>
2045 <FIELD NAME="data" TYPE="text" LENGTH="big" NOTNULL="false" SEQUENCE="false" COMMENT="dumping ground for portfolio callers to store their data in." PREVIOUS="id" NEXT="expirytime"/>
2046 <FIELD NAME="expirytime" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="time this record will expire (used for cron cleanups) - the start of export + 24 hours" PREVIOUS="data" NEXT="userid"/>
e1b9ac3e
PL
2047 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="psuedo fk to user. this is stored in the serialised data structure in the data field, but added here for ease of lookups." PREVIOUS="expirytime" NEXT="instance"/>
2048 <FIELD NAME="instance" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" COMMENT="which portfolio plugin instance is being used" PREVIOUS="userid"/>
04f35360 2049 </FIELDS>
2050 <KEYS>
ff2f69bc 2051 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="userfk"/>
e1b9ac3e
PL
2052 <KEY NAME="userfk" TYPE="foreign" FIELDS="userid" REFTABLE="user" REFFIELDS="id" COMMENT="fk to usertable" PREVIOUS="primary" NEXT="instance"/>
2053 <KEY NAME="instance" TYPE="foreign" FIELDS="instance" REFTABLE="portfolio_instance" REFFIELDS="id" COMMENT="fk to portfolio_instance" PREVIOUS="userfk"/>
04f35360 2054 </KEYS>
2055 </TABLE>
2056 <TABLE NAME="message_providers" COMMENT="This table stores the message providers (modules and core systems)" PREVIOUS="portfolio_tempdata" NEXT="message_processors">
3b120e46 2057 <FIELDS>
74c288a1 2058 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="true" COMMENT="id of the table, please edit me" NEXT="name"/>
2059 <FIELD NAME="name" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" COMMENT="The full name of the message provider in standard form" PREVIOUS="id" NEXT="component"/>
2060 <FIELD NAME="component" TYPE="char" LENGTH="200" NOTNULL="true" SEQUENCE="false" COMMENT="The name of the component that produces these messages" PREVIOUS="name" NEXT="capability"/>
2061 <FIELD NAME="capability" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" COMMENT="Optional: permission that is required on the user's setting screen to see this message provider." PREVIOUS="component"/>
3b120e46 2062 </FIELDS>
2063 <KEYS>
2064 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the table, please edit me"/>
2065 </KEYS>
120b3758 2066 <INDEXES>
2067 <INDEX NAME="componentname" UNIQUE="true" FIELDS="component, name" COMMENT="Unique index"/>
2068 </INDEXES>
3b120e46 2069 </TABLE>
2070 <TABLE NAME="message_processors" COMMENT="List of message output plugins" PREVIOUS="message_providers" NEXT="message_working">
2071 <FIELDS>
74c288a1 2072 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="true" COMMENT="id of the table, please edit me" NEXT="name"/>
2073 <FIELD NAME="name" TYPE="char" LENGTH="166" NOTNULL="true" SEQUENCE="false" COMMENT="Default comment for the field, please edit me" PREVIOUS="id"/>
3b120e46 2074 </FIELDS>
2075 <KEYS>
2076 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the table, please edit me"/>
2077 </KEYS>
2078 </TABLE>
04f35360 2079 <TABLE NAME="message_working" COMMENT="Lists all the messages and processors that need to be processed" PREVIOUS="message_processors" NEXT="files">
3b120e46 2080 <FIELDS>
74c288a1 2081 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="true" COMMENT="id of the table, please edit me" NEXT="unreadmessageid"/>
2082 <FIELD NAME="unreadmessageid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="message that still needs some processing (on message table)" PREVIOUS="id" NEXT="processorid"/>
2083 <FIELD NAME="processorid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="The processor with processes the message" PREVIOUS="unreadmessageid"/>
3b120e46 2084 </FIELDS>
2085 <KEYS>
2086 <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the table, please edit me"/>
2087 </KEYS>
2088 </TABLE>
1aa01caf 2089 <TABLE NAME="files" COMMENT="description of files, content stored in sha1 file pool" PREVIOUS="message_working" NEXT="repository">
172dd12c 2090 <FIELDS>
74c288a1 2091 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="contenthash"/>
2092 <FIELD NAME="contenthash" TYPE="char" LENGTH="40" NOTNULL="true" SEQUENCE="false" COMMENT="sha1 hash of file content" PREVIOUS="id" NEXT="pathnamehash"/>
2093 <FIELD NAME="pathnamehash" TYPE="char" LENGTH="40" NOTNULL="true" SEQUENCE="false" COMMENT="complete file path sha1 hash - unique for each file" PREVIOUS="contenthash" NEXT="contextid"/>
2094 <FIELD NAME="contextid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="The context id defined in context table - identifies the instance of plugin owning the file" PREVIOUS="pathnamehash" NEXT="filearea"/>
2095 <FIELD NAME="filearea" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" COMMENT="Like &quot;coursefiles&quot;. &quot;submission&quot;, &quot;intro&quot; and &quot;content&quot; (images and swf linked from summaries), etc." PREVIOUS="contextid" NEXT="itemid"/>
2096 <FIELD NAME="itemid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="Optional - some plugin specific item id (eg. forum post, blog entry or assignment submission, user id for user files)" PREVIOUS="filearea" NEXT="filepath"/>
2097 <FIELD NAME="filepath" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="Optional - relative path to file from module content root, useful in Scorm and Resource mod - most of the mods do not need this" PREVIOUS="itemid" NEXT="filename"/>
2098 <FIELD NAME="filename" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" COMMENT="The full Unicode name of this file (case sensitive) - some chars are not allowed though" PREVIOUS="filepath" NEXT="userid"/>
2099 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="Optional - general userid field - meaning depending on plugin" PREVIOUS="filename" NEXT="filesize"/>
2100 <FIELD NAME="filesize" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="userid" NEXT="mimetype"/>
2101 <FIELD NAME="mimetype" TYPE="char" LENGTH="100" NOTNULL="false" SEQUENCE="false" COMMENT="type of file - jpeg image, open document spreadsheet" PREVIOUS="filesize" NEXT="status"/>
f0b9ee18
PS
2102 <FIELD NAME="status" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="number greater than 0 means something is wrong with this file (virus, missing, etc.)" PREVIOUS="mimetype" NEXT="source"/>
2103 <FIELD NAME="source" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" COMMENT="contains the reference if the file is imported from external sites" PREVIOUS="status" NEXT="author"/>
1dce6261 2104 <FIELD NAME="author" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" COMMENT="The original author of the file" PREVIOUS="source" NEXT="license"/>
f0b9ee18
PS
2105 <FIELD NAME="license" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" COMMENT="license of the file to guide reuse" PREVIOUS="author" NEXT="timecreated"/>
2106 <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="license" NEXT="timemodified"/>
2107 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="timecreated"/>
172dd12c 2108 </FIELDS>
2109 <KEYS>
2110 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="contextid"/>
2111 <KEY NAME="contextid" TYPE="foreign" FIELDS="contextid" REFTABLE="context" REFFIELDS="id" PREVIOUS="primary" NEXT="userid"/>
2112 <KEY NAME="userid" TYPE="foreign" FIELDS="userid" REFTABLE="user" REFFIELDS="id" PREVIOUS="contextid"/>
2113 </KEYS>
2114 <INDEXES>
2115 <INDEX NAME="filearea-contextid-itemid" UNIQUE="false" FIELDS="filearea, contextid, itemid" NEXT="contenthash"/>
2116 <INDEX NAME="contenthash" UNIQUE="false" FIELDS="contenthash" PREVIOUS="filearea-contextid-itemid" NEXT="pathnamehash"/>
2117 <INDEX NAME="pathnamehash" UNIQUE="true" FIELDS="pathnamehash" PREVIOUS="contenthash"/>
2118 </INDEXES>
2119 </TABLE>
1aa01caf 2120 <TABLE NAME="repository" COMMENT="This table contains one entry for every configured external repository instance." PREVIOUS="files" NEXT="repository_instances">
27051e43 2121 <FIELDS>
74c288a1 2122 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="type"/>
2123 <FIELD NAME="type" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="id" NEXT="visible"/>
2124 <FIELD NAME="visible" TYPE="int" LENGTH="1" NOTNULL="false" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" PREVIOUS="type" NEXT="sortorder"/>
2125 <FIELD NAME="sortorder" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="visible"/>
27051e43 2126 </FIELDS>
2127 <KEYS>
2128 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
2129 </KEYS>
2130 </TABLE>
948c2860 2131 <TABLE NAME="repository_instances" COMMENT="This table contains one entry for every configured external repository instance." PREVIOUS="repository" NEXT="repository_instance_config">
27051e43 2132 <FIELDS>
74c288a1 2133 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="name"/>
2134 <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="id" NEXT="typeid"/>
2135 <FIELD NAME="typeid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="name" NEXT="userid"/>
2136 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="typeid" NEXT="contextid"/>
2137 <FIELD NAME="contextid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="userid" NEXT="username"/>
2138 <FIELD NAME="username" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" PREVIOUS="contextid" NEXT="password"/>
2139 <FIELD NAME="password" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" PREVIOUS="username" NEXT="timecreated"/>
2140 <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" PREVIOUS="password" NEXT="timemodified"/>
2141 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" PREVIOUS="timecreated" NEXT="readonly"/>
2142 <FIELD NAME="readonly" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="timemodified"/>
27051e43 2143 </FIELDS>
2144 <KEYS>
2145 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
2146 </KEYS>
2147 </TABLE>
eb6a973c 2148 <TABLE NAME="repository_instance_config" COMMENT="The config for intances" PREVIOUS="repository_instances" NEXT="backup_files">
27051e43 2149 <FIELDS>
74c288a1 2150 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="instanceid"/>
2151 <FIELD NAME="instanceid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="id" NEXT="name"/>
2152 <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="instanceid" NEXT="value"/>
2153 <FIELD NAME="value" TYPE="text" LENGTH="big" NOTNULL="false" SEQUENCE="false" PREVIOUS="name"/>
27051e43 2154 </FIELDS>
2155 <KEYS>
2156 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
2157 </KEYS>
2158 </TABLE>
eb6a973c 2159 <TABLE NAME="backup_files" COMMENT="To store and recode ids to user and course files" PREVIOUS="repository_instance_config" NEXT="backup_ids">
f1953d38 2160 <FIELDS>
74c288a1 2161 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="backup_code"/>
2162 <FIELD NAME="backup_code" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="file_type"/>
2163 <FIELD NAME="file_type" TYPE="char" LENGTH="10" NOTNULL="true" SEQUENCE="false" PREVIOUS="backup_code" NEXT="path"/>
2164 <FIELD NAME="path" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="file_type" NEXT="old_id"/>
2165 <FIELD NAME="old_id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="path" NEXT="new_id"/>
2166 <FIELD NAME="new_id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="old_id"/>
f1953d38 2167 </FIELDS>
2168 <KEYS>
2169 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="backup_code-file_type-path"/>
2170 <KEY NAME="backup_code-file_type-path" TYPE="unique" FIELDS="backup_code, file_type, path" PREVIOUS="primary"/>
2171 </KEYS>
2172 </TABLE>
2173 <TABLE NAME="backup_ids" COMMENT="To store and convert ids in backup/restore" PREVIOUS="backup_files" NEXT="backup_courses">
2174 <FIELDS>
74c288a1 2175 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="backup_code"/>
2176 <FIELD NAME="backup_code" TYPE="int" LENGTH="12" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="table_name"/>
2177 <FIELD NAME="table_name" TYPE="char" LENGTH="30" NOTNULL="true" SEQUENCE="false" PREVIOUS="backup_code" NEXT="old_id"/>
2178 <FIELD NAME="old_id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="table_name" NEXT="new_id"/>
2179 <FIELD NAME="new_id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="old_id" NEXT="info"/>
2180 <FIELD NAME="info" TYPE="text" LENGTH="medium" NOTNULL="true" SEQUENCE="false" PREVIOUS="new_id"/>
f1953d38 2181 </FIELDS>
2182 <KEYS>
2183 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="backup_code-table_name-old_id"/>
2184 <KEY NAME="backup_code-table_name-old_id" TYPE="unique" FIELDS="backup_code, table_name, old_id" PREVIOUS="primary"/>
2185 </KEYS>
2186 </TABLE>
2187 <TABLE NAME="backup_courses" COMMENT="To store every course backup status" PREVIOUS="backup_ids" NEXT="backup_log">
2188 <FIELDS>
74c288a1 2189 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="courseid"/>
2190 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="laststarttime"/>
2191 <FIELD NAME="laststarttime" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="courseid" NEXT="lastendtime"/>
2192 <FIELD NAME="lastendtime" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="laststarttime" NEXT="laststatus"/>
2193 <FIELD NAME="laststatus" TYPE="char" LENGTH="1" NOTNULL="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="lastendtime" NEXT="nextstarttime"/>
2194 <FIELD NAME="nextstarttime" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="laststatus"/>
f1953d38 2195 </FIELDS>
2196 <KEYS>
2197 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="courseid"/>
2198 <KEY NAME="courseid" TYPE="unique" FIELDS="courseid" PREVIOUS="primary"/>
2199 </KEYS>
2200 </TABLE>
ab2eb65c 2201 <TABLE NAME="backup_log" COMMENT="To store every course backup log info" PREVIOUS="backup_courses" NEXT="block">
f1953d38 2202 <FIELDS>
74c288a1 2203 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="courseid"/>
2204 <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="time"/>
2205 <FIELD NAME="time" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="courseid" NEXT="laststarttime"/>
2206 <FIELD NAME="laststarttime" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="time" NEXT="info"/>
2207 <FIELD NAME="info" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="laststarttime" NEXT="backuptype"/>
2208 <FIELD NAME="backuptype" TYPE="char" LENGTH="50" NOTNULL="true" SEQUENCE="false" PREVIOUS="info"/>
f1953d38 2209 </FIELDS>
2210 <KEYS>
2211 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="courseid"/>
2212 <KEY NAME="courseid" TYPE="foreign" FIELDS="courseid" REFTABLE="backup_courses" REFFIELDS="courseid" PREVIOUS="primary"/>
2213 </KEYS>
2214 </TABLE>
66b10689 2215 <TABLE NAME="block" COMMENT="contains all installed blocks" PREVIOUS="backup_log" NEXT="block_instances">
ab2eb65c 2216 <FIELDS>
74c288a1 2217 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="name"/>
2218 <FIELD NAME="name" TYPE="char" LENGTH="40" NOTNULL="true" SEQUENCE="false" PREVIOUS="id" NEXT="version"/>
2219 <FIELD NAME="version" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="name" NEXT="cron"/>
2220 <FIELD NAME="cron" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="version" NEXT="lastcron"/>
2221 <FIELD NAME="lastcron" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="cron" NEXT="visible"/>
2222 <FIELD NAME="visible" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" DEFAULT="1" SEQUENCE="false" PREVIOUS="lastcron" NEXT="multiple"/>
2223 <FIELD NAME="multiple" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" PREVIOUS="visible"/>
ab2eb65c 2224 </FIELDS>
2225 <KEYS>
2226 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
2227 </KEYS>
66b10689 2228 <INDEXES>
2229 <INDEX NAME="name" UNIQUE="true" FIELDS="name"/>
2230 </INDEXES>
ab2eb65c 2231 </TABLE>
13a0d3d3 2232 <TABLE NAME="block_instances" COMMENT="This table stores block instances. The type of block this is is given by the blockname column. The places this block instance appears is controlled by the parentcontexid, showinsubcontexts, pagetypepattern and subpagepattern fields. Where the block appears on the page (by default) is controlled by the defaultposition and defaultweight columns. The block's own configuration is stored serialized in configdata." PREVIOUS="block" NEXT="block_positions">
ab2eb65c 2233 <FIELDS>
66b10689 2234 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="blockname"/>
13a0d3d3 2235 <FIELD NAME="blockname" TYPE="char" LENGTH="40" NOTNULL="true" SEQUENCE="false" COMMENT="The type of block this is. Foreign key, references block.name." PREVIOUS="id" NEXT="parentcontextid"/>
2236 <FIELD NAME="parentcontextid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="The context within which this block appears. Foreign key, references context.id." PREVIOUS="blockname" NEXT="showinsubcontexts"/>
2237 <FIELD NAME="showinsubcontexts" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="false" SEQUENCE="false" COMMENT="If 1, this block appears on all matching pages in subcontexts of parentcontextid, as well in pages belonging to parentcontextid." PREVIOUS="parentcontextid" NEXT="pagetypepattern"/>
66b10689 2238 <FIELD NAME="pagetypepattern" TYPE="char" LENGTH="64" NOTNULL="true" SEQUENCE="false" COMMENT="The types of page this block appears on. Either an exact page type like mod-quiz-view, or a pattern like mod-quiz-* or course-view-*. Note that course-view-* will match course-view." PREVIOUS="showinsubcontexts" NEXT="subpagepattern"/>
2239 <FIELD NAME="subpagepattern" TYPE="char" LENGTH="16" NOTNULL="false" SEQUENCE="false" COMMENT="Further restrictions on where this block appears. In some places, e.g. during a quiz or lesson attempt, different pages have different subpage ids. If this field is not null, the block only appears on that particular subpage." PREVIOUS="pagetypepattern" NEXT="defaultregion"/>
2240 <FIELD NAME="defaultregion" TYPE="char" LENGTH="16" NOTNULL="true" SEQUENCE="false" COMMENT="Which block region this block should appear in on each page, in the absence of a specific position in the block_positions table." PREVIOUS="subpagepattern" NEXT="defaultweight"/>
2241 <FIELD NAME="defaultweight" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="false" COMMENT="Used to order the blocks within a block region. Again, may be overridden by the block_positions table for a specific page where this block appears." PREVIOUS="defaultregion" NEXT="configdata"/>
2242 <FIELD NAME="configdata" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" COMMENT="A serialized blob of configuration data for this block instance." PREVIOUS="defaultweight"/>
ab2eb65c 2243 </FIELDS>
2244 <KEYS>
13a0d3d3 2245 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="parentcontextid"/>
2246 <KEY NAME="parentcontextid" TYPE="foreign" FIELDS="parentcontextid" REFTABLE="context" REFFIELDS="id" PREVIOUS="primary"/>
ab2eb65c 2247 </KEYS>
2248 <INDEXES>
13a0d3d3 2249 <INDEX NAME="parentcontextid-showinsubcontexts-pagetypepattern-subpagepattern" UNIQUE="false" FIELDS="parentcontextid, showinsubcontexts, pagetypepattern, subpagepattern"/>
ab2eb65c 2250 </INDEXES>
2251 </TABLE>
5a529a53 2252 <TABLE NAME="block_positions" COMMENT="Stores the position of a sticky block_instance on a another page than the one where it was added." PREVIOUS="block_instances" NEXT="comments">
ab2eb65c 2253 <FIELDS>
66b10689 2254 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="blockinstanceid"/>
2255 <FIELD NAME="blockinstanceid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="The block_instance this position relates to." PREVIOUS="id" NEXT="contextid"/>
2256 <FIELD NAME="contextid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="With pagetype and subpage, defines the page we are setting the position for." PREVIOUS="blockinstanceid" NEXT="pagetype"/>
2257 <FIELD NAME="pagetype" TYPE="char" LENGTH="64" NOTNULL="true" SEQUENCE="false" COMMENT="With contextid and subpage, defines the page we are setting the position for." PREVIOUS="contextid" NEXT="subpage"/>
2258 <FIELD NAME="subpage" TYPE="char" LENGTH="16" NOTNULL="true" SEQUENCE="false" COMMENT="With contextid and pagetype, defines the page we are setting the position for." PREVIOUS="pagetype" NEXT="visible"/>
2259 <FIELD NAME="visible" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="false" SEQUENCE="false" COMMENT="Whether this block instance is visible on this page." PREVIOUS="subpage" NEXT="region"/>
2260 <FIELD NAME="region" TYPE="char" LENGTH="16" NOTNULL="true" SEQUENCE="false" COMMENT="Which block region on this page this block should appear in." PREVIOUS="visible" NEXT="weight"/>
2261 <FIELD NAME="weight" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="false" COMMENT="Used to order the blocks within a block region." PREVIOUS="region"/>
ab2eb65c 2262 </FIELDS>
2263 <KEYS>
66b10689 2264 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="blockinstanceid"/>
2265 <KEY NAME="blockinstanceid" TYPE="foreign" FIELDS="blockinstanceid" REFTABLE="block_instances" REFFIELDS="id" PREVIOUS="primary" NEXT="contextid"/>
2266 <KEY NAME="contextid" TYPE="foreign" FIELDS="contextid" REFTABLE="context" REFFIELDS="id" PREVIOUS="blockinstanceid"/>
ab2eb65c 2267 </KEYS>
2268 <INDEXES>
66b10689 2269 <INDEX NAME="blockinstanceid-contextid-pagetype-subpage" UNIQUE="true" FIELDS="blockinstanceid, contextid, pagetype, subpage"/>
ab2eb65c 2270 </INDEXES>
2271 </TABLE>
975341d1 2272 <TABLE NAME="comments" COMMENT="moodle comments module" PREVIOUS="block_positions" NEXT="external_services">
5a529a53 2273 <FIELDS>
2274 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="contextid"/>
2275 <FIELD NAME="contextid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="id" NEXT="commentarea"/>
2276 <FIELD NAME="commentarea" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="contextid" NEXT="itemid"/>
2277 <FIELD NAME="itemid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="commentarea" NEXT="content"/>
2278 <FIELD NAME="content" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" PREVIOUS="itemid" NEXT="format"/>
2279 <FIELD NAME="format" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="content" NEXT="userid"/>
2280 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="format" NEXT="timecreated"/>
2281 <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="userid"/>
2282 </FIELDS>
2283 <KEYS>
2284 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
2285 </KEYS>
2286 </TABLE>
975341d1 2287 <TABLE NAME="external_services" COMMENT="built in and custom external services" PREVIOUS="comments" NEXT="external_functions">
5a529a53 2288 <FIELDS>
2289 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="name"/>
975341d1 2290 <FIELD NAME="name" TYPE="char" LENGTH="200" NOTNULL="true" SEQUENCE="false" PREVIOUS="id" NEXT="enabled"/>
2291 <FIELD NAME="enabled" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="name" NEXT="requiredcapability"/>
2292 <FIELD NAME="requiredcapability" TYPE="char" LENGTH="150" NOTNULL="false" SEQUENCE="false" PREVIOUS="enabled" NEXT="restrictedusers"/>
2293 <FIELD NAME="restrictedusers" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="requiredcapability" NEXT="component"/>
2294 <FIELD NAME="component" TYPE="char" LENGTH="100" NOTNULL="false" SEQUENCE="false" PREVIOUS="restrictedusers" NEXT="timecreated"/>
2295 <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="component" NEXT="timemodified"/>
2296 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" PREVIOUS="timecreated"/>
5a529a53 2297 </FIELDS>
2298 <KEYS>
2299 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
2300 </KEYS>
2301 <INDEXES>
975341d1 2302 <INDEX NAME="name" UNIQUE="true" FIELDS="name"/>
5a529a53 2303 </INDEXES>
2304 </TABLE>
975341d1 2305 <TABLE NAME="external_functions" COMMENT="list of all external functions" PREVIOUS="external_services" NEXT="external_services_functions">
5a529a53 2306 <FIELDS>
2307 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="name"/>
975341d1 2308 <FIELD NAME="name" TYPE="char" LENGTH="200" NOTNULL="true" SEQUENCE="false" PREVIOUS="id" NEXT="classname"/>
2309 <FIELD NAME="classname" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" PREVIOUS="name" NEXT="methodname"/>
2310 <FIELD NAME="methodname" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" PREVIOUS="classname" NEXT="classpath"/>
2311 <FIELD NAME="classpath" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" PREVIOUS="methodname" NEXT="component"/>
2312 <FIELD NAME="component" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" PREVIOUS="classpath"/>
5a529a53 2313 </FIELDS>
2314 <KEYS>
2315 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
2316 </KEYS>
2317 <INDEXES>
975341d1 2318 <INDEX NAME="name" UNIQUE="true" FIELDS="name" COMMENT="the external function names must be globally unique"/>
5a529a53 2319 </INDEXES>
2320 </TABLE>
975341d1 2321 <TABLE NAME="external_services_functions" COMMENT="lists functions available in each service group" PREVIOUS="external_functions" NEXT="external_services_users">
cae83708 2322 <FIELDS>
9c8c6c29 2323 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="externalserviceid"/>
2324 <FIELD NAME="externalserviceid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="id" NEXT="functionname"/>
2325 <FIELD NAME="functionname" TYPE="char" LENGTH="200" NOTNULL="true" SEQUENCE="false" PREVIOUS="externalserviceid"/>
cae83708 2326 </FIELDS>
2327 <KEYS>
9c8c6c29 2328 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="externalserviceid"/>
2329 <KEY NAME="externalserviceid" TYPE="foreign" FIELDS="externalserviceid" REFTABLE="external_services" REFFIELDS="id" PREVIOUS="primary"/>
cae83708 2330 </KEYS>
cae83708 2331 </TABLE>
1942103f 2332 <TABLE NAME="external_services_users" COMMENT="users allowed to use services with restricted users flag" PREVIOUS="external_services_functions" NEXT="external_tokens">
cae83708 2333 <FIELDS>
9c8c6c29 2334 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="externalserviceid"/>
2335 <FIELD NAME="externalserviceid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="id" NEXT="userid"/>
88af54fa 2336 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="externalserviceid" NEXT="iprestriction"/>
2337 <FIELD NAME="iprestriction" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" COMMENT="ip restriction" PREVIOUS="userid" NEXT="validuntil"/>
2338 <FIELD NAME="validuntil" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="timestampt - valid until data" PREVIOUS="iprestriction" NEXT="timecreated"/>
2339 <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="created timestamp" PREVIOUS="validuntil"/>
9baf6825 2340 </FIELDS>
2341 <KEYS>
9c8c6c29 2342 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="externalserviceid"/>
2343 <KEY NAME="externalserviceid" TYPE="foreign" FIELDS="externalserviceid" REFTABLE="external_services" REFFIELDS="id" PREVIOUS="primary" NEXT="userid"/>
2344 <KEY NAME="userid" TYPE="foreign" FIELDS="userid" REFTABLE="user" REFFIELDS="id" PREVIOUS="externalserviceid"/>
9baf6825 2345 </KEYS>
9c8c6c29 2346 </TABLE>
cc82aef6 2347 <TABLE NAME="external_tokens" COMMENT="Security tokens for accessing of external services" PREVIOUS="external_services_users" NEXT="blog_association">
1942103f
PS
2348 <FIELDS>
2349 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="token"/>
2350 <FIELD NAME="token" TYPE="char" LENGTH="128" NOTNULL="true" SEQUENCE="false" COMMENT="security token, aka private access key" PREVIOUS="id" NEXT="tokentype"/>
2351 <FIELD NAME="tokentype" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="type of token: 0=permanent, no session; 1=linked to current browser session via sid; 2=permanent, with emulated session" PREVIOUS="token" NEXT="userid"/>
2352 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="owner of the token" PREVIOUS="tokentype" NEXT="externalserviceid"/>
2353 <FIELD NAME="externalserviceid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="userid" NEXT="sid"/>
2354 <FIELD NAME="sid" TYPE="char" LENGTH="128" NOTNULL="false" SEQUENCE="false" COMMENT="link to browser or emulated session" PREVIOUS="externalserviceid" NEXT="contextid"/>
5ae9f539 2355 <FIELD NAME="contextid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="context id where in token valid" PREVIOUS="sid" NEXT="creatorid"/>
2356 <FIELD NAME="creatorid" TYPE="int" LENGTH="20" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" COMMENT="user id of the token creator (useful to know when the administrator created a token and so display the token to a specific administrator)" PREVIOUS="contextid" NEXT="iprestriction"/>
2357 <FIELD NAME="iprestriction" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" COMMENT="ip restriction" PREVIOUS="creatorid" NEXT="validuntil"/>
1942103f
PS
2358 <FIELD NAME="validuntil" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="timestampt - valid until data" PREVIOUS="iprestriction" NEXT="timecreated"/>
2359 <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="created timestamp" PREVIOUS="validuntil" NEXT="lastaccess"/>
2360 <FIELD NAME="lastaccess" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="last access timestamp" PREVIOUS="timecreated"/>
2361 </FIELDS>
2362 <KEYS>
2363 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="userid"/>
2364 <KEY NAME="userid" TYPE="foreign" FIELDS="userid" REFTABLE="user" REFFIELDS="id" PREVIOUS="primary" NEXT="externalserviceid"/>
2365 <KEY NAME="externalserviceid" TYPE="foreign" FIELDS="externalserviceid" REFTABLE="external_services" REFFIELDS="id" PREVIOUS="userid" NEXT="contextid"/>
5ae9f539 2366 <KEY NAME="contextid" TYPE="foreign" FIELDS="contextid" REFTABLE="context" REFFIELDS="id" PREVIOUS="externalserviceid" NEXT="creatorid"/>
2367 <KEY NAME="creatorid" TYPE="foreign" FIELDS="creatorid" REFTABLE="user" REFFIELDS="id" PREVIOUS="contextid"/>
1942103f
PS
2368 </KEYS>
2369 </TABLE>
cc82aef6
NC
2370 <TABLE NAME="blog_association" COMMENT="Associations of blog entries with courses and module instances" PREVIOUS="external_tokens" NEXT="blog_external">
2371 <FIELDS>
2372 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="contextid"/>
2373 <FIELD NAME="contextid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="id" NEXT="blogid"/>
2374 <FIELD NAME="blogid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="contextid"/>
2375 </FIELDS>
2376 <KEYS>
2377 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="contextid"/>
2378 <KEY NAME="contextid" TYPE="foreign" FIELDS="contextid" REFTABLE="context" REFFIELDS="id" PREVIOUS="primary" NEXT="blogid"/>
2379 <KEY NAME="blogid" TYPE="foreign" FIELDS="blogid" REFTABLE="post" REFFIELDS="id" PREVIOUS="contextid"/>
2380 </KEYS>
2381 </TABLE>
e32a0646 2382 <TABLE NAME="blog_external" COMMENT="External blog links used for RSS copying of blog entries to Moodle user blogs" PREVIOUS="blog_association" NEXT="rating">
cc82aef6
NC
2383 <FIELDS>
2384 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="userid"/>
2385 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="id" NEXT="name"/>
2386 <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="userid" NEXT="description"/>
2387 <FIELD NAME="description" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" PREVIOUS="name" NEXT="url"/>
2388 <FIELD NAME="url" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" PREVIOUS="description" NEXT="filtertags"/>
2389 <FIELD NAME="filtertags" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" COMMENT="Comma-separated list of tags that will be used to filter which entries are copied over from the external blog. They refer to existing tags in the external blog." PREVIOUS="url" NEXT="failedlastsync"/>
2390 <FIELD NAME="failedlastsync" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Whether or not the last sync failed for some reason" PREVIOUS="filtertags" NEXT="timemodified"/>
2391 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" PREVIOUS="failedlastsync" NEXT="timefetched"/>
2392 <FIELD NAME="timefetched" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="timemodified"/>
2393 </FIELDS>
2394 <KEYS>
2395 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="userid"/>
2396 <KEY NAME="userid" TYPE="foreign" FIELDS="userid" REFTABLE="user" REFFIELDS="id" PREVIOUS="primary"/>
2397 </KEYS>
2398 </TABLE>
1dce6261 2399 <TABLE NAME="rating" COMMENT="moodle ratings" PREVIOUS="blog_external" NEXT="license">
a09aeee4
AD
2400 <FIELDS>
2401 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="contextid"/>
2402 <FIELD NAME="contextid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="id" NEXT="itemid"/>
2403 <FIELD NAME="itemid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="contextid" NEXT="scaleid"/>
80350ef6 2404 <FIELD NAME="scaleid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="false" PREVIOUS="itemid" NEXT="rating"/>
a09aeee4
AD
2405 <FIELD NAME="rating" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="scaleid" NEXT="userid"/>
2406 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="rating" NEXT="timecreated"/>
2407 <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="userid" NEXT="timemodified"/>
2408 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" PREVIOUS="timecreated"/>
2409 </FIELDS>
2410 <KEYS>
2411 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
2412 </KEYS>
2413 </TABLE>
ee4d3dee 2414 <TABLE NAME="license" COMMENT="store licenses used by moodle" PREVIOUS="rating" NEXT="backup_controllers">
1dce6261
DC
2415 <FIELDS>
2416 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="shortname"/>
2417 <FIELD NAME="shortname" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" PREVIOUS="id" NEXT="fullname"/>
2418 <FIELD NAME="fullname" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" PREVIOUS="shortname" NEXT="source"/>
2419 <FIELD NAME="source" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" PREVIOUS="fullname" NEXT="enabled"/>
2420 <FIELD NAME="enabled" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" PREVIOUS="source" NEXT="version"/>
2421 <FIELD NAME="version" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" PREVIOUS="enabled"/>
2422 </FIELDS>
2423 <KEYS>
2424 <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
2425 </KEYS>
2426 </TABLE>
ee4d3dee
EL
2427 <TABLE NAME="backup_controllers" COMMENT="To store the backup_controllers as they are used" PREVIOUS="license" NEXT="backup_ids_template">
2428 <FIELDS>
2429 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="backupid"/>
2430 <FIELD NAME="backupid" TYPE="char" LENGTH="32" NOTNULL="true" SEQUENCE="false" COMMENT="unique id of the backup" PREVIOUS="id" NEXT="type"/>
2431 <FIELD NAME="type" TYPE="char" LENGTH="6" NOTNULL="true" SEQUENCE="false" COMMENT="Type of the backup (activity/section/course)" PREVIOUS="backupid" NEXT="itemid"/>
2432 <FIELD NAME="itemid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="id of the module/section/activity being backup" PREVIOUS="type" NEXT="format"/>
2433 <FIELD NAME="format" TYPE="char" LENGTH="20" NOTNULL="true" SEQUENCE="false" COMMENT="format of the backup (moodle/imscc...)" PREVIOUS="itemid" NEXT="interactive"/>
2434 <FIELD NAME="interactive" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="is the backup interactive (1-yes/0-no)" PREVIOUS="format" NEXT="purpose"/>
2435 <FIELD NAME="purpose" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="purpose (target) of the backup (general, import, hub...)" PREVIOUS="interactive" NEXT="userid"/>
2436 <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="user that owns/performs the backup" PREVIOUS="purpose" NEXT="status"/>
2437 <FIELD NAME="status" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="current status of the backup (configured, ui, running...)" PREVIOUS="userid" NEXT="execution"/>
2438 <FIELD NAME="execution" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="type of execution (immediate/delayed)" PREVIOUS="status" NEXT="executiontime"/>
2439 <FIELD NAME="executiontime" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="epoch secs when the backup should be executed (for delayed backups only)" PREVIOUS="execution" NEXT="checksum"/>
2440 <FIELD NAME="checksum" TYPE="char" LENGTH="32" NOTNULL="true" SEQUENCE="false" COMMENT="checksum of the backup_controller object" PREVIOUS="executiontime" NEXT="timecreated"/>
2441 <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="time the controller was created" PREVIOUS="checksum" NEXT="timemodified"/>
2442 <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="last time the controller was modified" PREVIOUS="timecreated" NEXT="controller"/>
2443 <FIELD NAME="controller" TYPE="text" LENGTH="big" NOTNULL="true" SEQUENCE="false" COMMENT="serialised backup_controller object" PREVIOUS="timemodified"/>
2444 </FIELDS>
2445 <KEYS>
2446 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="backupid_uk"/>
2447 <KEY NAME="backupid_uk" TYPE="unique" FIELDS="backupid" PREVIOUS="primary" NEXT="userid_fk"/>
2448 <KEY NAME="userid_fk" TYPE="foreign" FIELDS="userid" REFTABLE="user" REFFIELDS="id" PREVIOUS="backupid_uk"/>
2449 </KEYS>
2450 <INDEXES>
2451 <INDEX NAME="typeitem_ix" UNIQUE="false" FIELDS="type, itemid"/>
2452 </INDEXES>
2453 </TABLE>
2454 <TABLE NAME="backup_ids_template" COMMENT="To store all sort of ids along the backup process. Note this table isn't really used but its temporary counterpart." PREVIOUS="backup_controllers">
2455 <FIELDS>
2456 <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="backupid"/>
2457 <FIELD NAME="backupid" TYPE="char" LENGTH="32" NOTNULL="true" SEQUENCE="false" COMMENT="unique id of the backup" PREVIOUS="id" NEXT="itemname"/>
2458 <FIELD NAME="itemname" TYPE="char" LENGTH="30" NOTNULL="true" SEQUENCE="false" COMMENT="name of the component this id belongs to (usually table names)" PREVIOUS="backupid" NEXT="itemid"/>
2459 <FIELD NAME="itemid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" COMMENT="id of the component (usually table-&amp;gt;id values)" PREVIOUS="itemname" NEXT="parentitemid"/>
2460 <FIELD NAME="parentitemid" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" COMMENT="other id that can be useful to represent parent-child relations" PREVIOUS="itemid"/>
2461 </FIELDS>
2462 <KEYS>
2463 <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="backupid_itemname_itemid_uk"/>
2464 <KEY NAME="backupid_itemname_itemid_uk" TYPE="unique" FIELDS="backupid, itemname, itemid" PREVIOUS="primary"/>
2465 </KEYS>
2466 <INDEXES>
2467 <INDEX NAME="backupid_parentitemid_ix" UNIQUE="false" FIELDS="backupid, itemname, parentitemid"/>
2468 </INDEXES>
2469 </TABLE>
67d7d694 2470 </TABLES>
f0b9ee18 2471</XMLDB>