install.xml 52.4 KB
Newer Older
1
2
3
4
5
<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="lib/db" VERSION="20060926" COMMENT="XMLDB file for core Mahara tables"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="../../lib/xmldb/xmldb.xsd"
>
6
    <TABLES>
Penny Leach's avatar
Penny Leach committed
7
        <!-- core tables that plugins rely on -->
8
9
        <TABLE NAME="config">
            <FIELDS>
10
11
                <FIELD NAME="field" TYPE="char" LENGTH="255" NOTNULL="true"/>
                <FIELD NAME="value" TYPE="text" LENGTH="small"/>
12
13
            </FIELDS>
            <KEYS>
14
                <KEY NAME="primary" TYPE="primary" FIELDS="field" />
15
16
            </KEYS>
        </TABLE>
17
18
        <TABLE NAME="auth_installed">
            <FIELDS> 
19
                <FIELD NAME="name" TYPE="char" LENGTH="100" NOTNULL="true" />
20
21
22
                <FIELD NAME="version" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="release" TYPE="text" LENGTH="small" NOTNULL="true" />
                <FIELD NAME="active" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1" />
23
                <FIELD NAME="requires_config" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
24
25
26
27
28
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="name" />
            </KEYS>
        </TABLE>
29
30
31
32
33
34
35
36
37
38
        <TABLE NAME="application">
            <FIELDS>
                <FIELD NAME="shortname" TYPE="char" LENGTH="20" NOTNULL="true" />
                <FIELD NAME="name" TYPE="char" LENGTH="100" NOTNULL="true" />
                <FIELD NAME="xmlrpcserverurl" TYPE="char" LENGTH="255" NOTNULL="true" />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="shortname" />
            </KEYS>
        </TABLE>
39
40
        <TABLE NAME="institution">
            <FIELDS>
41
42
43
44
                <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true"/>
                <FIELD NAME="displayname" TYPE="char" LENGTH="255" NOTNULL="true"/>
                <FIELD NAME="registerallowed" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1"/>
                <FIELD NAME="updateuserinfoonlogin" TYPE="int" LENGTH="1" NOTNULL="false" DEFAULT="0"/>
45
                <FIELD NAME="defaultaccountlifetime" TYPE="int" NOTNULL="false"/>
46
47
                <FIELD NAME="defaultaccountinactiveexpire" TYPE="int" NOTNULL="false"/>
                <FIELD NAME="defaultaccountinactivewarn" TYPE="int" NOTNULL="false" DEFAULT="604800"/>
48
49
50
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="name" />
51
52
53
54
55
56
57
58
59
60
61
62
63
64
            </KEYS>
        </TABLE>
        <TABLE NAME="auth_instance">
            <FIELDS> 
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
                <FIELD NAME="instancename" TYPE="char" LENGTH="255" NOTNULL="true" />
                <FIELD NAME="priority" TYPE="int" LENGTH="2" NOTNULL="true" DEFAULT="0" />
                <FIELD NAME="institution" TYPE="char" LENGTH="255" NOTNULL="true" />
                <FIELD NAME="authname" TYPE="char" LENGTH="255" NOTNULL="true" />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
                <KEY NAME="authnamefk" TYPE="foreign" FIELDS="authname" REFTABLE="auth_installed" REFFIELDS="name" />
                <KEY NAME="institutionfk" TYPE="foreign" FIELDS="institution" REFTABLE="institution" REFFIELDS="name" />
65
            </KEYS>
66
67
68
69
70
71
72
73
74
75
        </TABLE>
        <TABLE NAME="institution_locked_profile_field">
            <FIELDS>
                <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true"/>
                <FIELD NAME="profilefield" TYPE="char" LENGTH="255" NOTNULL="true"/>
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="name, profilefield"/>
                <KEY NAME="name" TYPE="foreign" FIELDS="name" REFTABLE="institution" REFFIELDS="name"/>
            </KEYS>
76
        </TABLE>
77
        <TABLE NAME="usr">
78
            <FIELDS>
79
80
81
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
                <FIELD NAME="username" TYPE="char" LENGTH="30" NOTNULL="true"/>
                <FIELD NAME="password" TYPE="char" LENGTH="40" NOTNULL="true"/>
82
                <FIELD NAME="institution" TYPE="char" LENGTH="255" NOTNULL="true" DEFAULT="mahara"/>
83
84
                <FIELD NAME="salt" TYPE="char" LENGTH="8"/>
                <FIELD NAME="passwordchange" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0"/>
85
                <FIELD NAME="active" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1"/>
86
87
                <FIELD NAME="deleted" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0"/>
                <FIELD NAME="expiry" TYPE="datetime" NOTNULL="false"/>
88
                <FIELD NAME="expirymailsent" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0"/>
89
                <FIELD NAME="lastlogin" TYPE="datetime" NOTNULL="false"/>
90
                <FIELD NAME="inactivemailsent" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0"/>
91
92
93
94
95
96
97
                <FIELD NAME="staff" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0"/>
                <FIELD NAME="admin" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0"/>
                <FIELD NAME="firstname" TYPE="text" NOTNULL="false"/>
                <FIELD NAME="lastname" TYPE="text" NOTNULL="false"/>
                <FIELD NAME="studentid" TYPE="text" NOTNULL="false"/>
                <FIELD NAME="preferredname" TYPE="text" NOTNULL="false"/>
                <FIELD NAME="email" TYPE="text" NOTNULL="false"/>
98
99
100
101
                <!-- This field should be foreign keyed to the artefact table, however the
                artefact table already has a key to this table, and XMLDB isn't smart enough
                to create the tables first, then the keys. -->
                <FIELD NAME="profileicon" TYPE="int" LENGTH="10" NOTNULL="false"/>
Nigel McNie's avatar
Nigel McNie committed
102
103
104
                <FIELD NAME="suspendedctime" TYPE="datetime" NOTNULL="false"/>
                <FIELD NAME="suspendedreason" TYPE="text" NOTNULL="false"/>
                <FIELD NAME="suspendedcusr" TYPE="int" LENGTH="10" NOTNULL="false"/>
105
106
                <FIELD NAME="quota" TYPE="int" LENGTH="10" NOTNULL="false"/>
                <FIELD NAME="quotaused" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" />
107
108
                <FIELD NAME="authinstance" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="1" />
                <FIELD NAME="sessionid" TYPE="char" LENGTH="32" NOTNULL="false" DEFAULT="" />
109
110
            </FIELDS>
            <KEYS>
111
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
112
                <KEY NAME="institution" TYPE="foreign" FIELDS="institution" REFTABLE="institution" REFFIELDS="name"/>
113
114
            </KEYS>
            <INDEXES>
Penny Leach's avatar
Penny Leach committed
115
                <INDEX NAME="usernameuk" UNIQUE="true" FIELDS="username,institution"/>
116
117
            </INDEXES>
        </TABLE>
Penny Leach's avatar
Penny Leach committed
118
        <TABLE NAME="event_type">
119
120
121
122
123
            <FIELDS>
                <FIELD NAME="name" TYPE="char" LENGTH="50" NOTNULL="true" />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="name" />
124
125
            </KEYS>
        </TABLE>
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
        <TABLE NAME="host">
            <FIELDS>
                <FIELD NAME="wwwroot" TYPE="char" LENGTH="255" NOTNULL="true"  />
                <FIELD NAME="name" TYPE="char" LENGTH="80" NOTNULL="true" DEFAULT=""  />
                <FIELD NAME="ipaddress" TYPE="char" LENGTH="39" NOTNULL="true" DEFAULT=""  />
                <FIELD NAME="deleted" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0"/>
                <FIELD NAME="publickey" TYPE="text" NOTNULL="true" DEFAULT=""  />
                <FIELD NAME="publickeyexpires" TYPE="int" LENGTH="10" NOTNULL="true"  />
                <FIELD NAME="portno" TYPE="int" LENGTH="2" NOTNULL="true" DEFAULT="80"  />
                <FIELD NAME="lastconnecttime" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0"  />
                <FIELD NAME="application" TYPE="char" LENGTH="20" NOTNULL="true" DEFAULT=""  />
                <FIELD NAME="theyssoin" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0"  />
                <FIELD NAME="wessoout" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0"  />
                <FIELD NAME="institution" TYPE="char" LENGTH="255" NOTNULL="true"  />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="wwwroot" />
                <KEY NAME="institution" TYPE="foreign" FIELDS="institution" REFTABLE="institution" REFFIELDS="name"/>
                <KEY NAME="application" TYPE="foreign" FIELDS="application" REFTABLE="application" REFFIELDS="shortname"/>
            </KEYS>
        </TABLE>
147
148
149
150
151
152
153
154
155
156
157
158
        <TABLE NAME="cron">
            <FIELDS>
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
                <FIELD NAME="callfunction" TYPE="char" LENGTH="255" NOTNULL="true"  />
                <FIELD NAME="nextrun" TYPE="datetime" NOTNULL="false"  />
                <FIELD NAME="minute" TYPE="char" LENGTH="25" NOTNULL="true" DEFAULT="*"  />
                <FIELD NAME="hour" TYPE="char" LENGTH="25" NOTNULL="true" DEFAULT="*"  />
                <FIELD NAME="day" TYPE="char" LENGTH="25" NOTNULL="true" DEFAULT="*"  />
                <FIELD NAME="month" TYPE="char" LENGTH="25" NOTNULL="true" DEFAULT="*"  />
                <FIELD NAME="dayofweek" TYPE="char" LENGTH="25" NOTNULL="true" DEFAULT="*" />
            </FIELDS>
            <KEYS>
159
160
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
                <KEY NAME="callfunctionuk" TYPE="unique" FIELDS="callfunction" />
161
162
            </KEYS>
        </TABLE>
Penny Leach's avatar
Penny Leach committed
163
164
165
        <TABLE NAME="activity_type">
            <FIELDS>
                <FIELD NAME="name" TYPE="char" LENGTH="50" NOTNULL="true" />
166
                <FIELD NAME="admin" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
167
                <FIELD NAME="delay" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1" />
Penny Leach's avatar
Penny Leach committed
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="name" />
            </KEYS>
        </TABLE>
        <TABLE NAME="activity_queue">
            <FIELDS>
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
                <FIELD NAME="type" TYPE="char" LENGTH="50" NOTNULL="true" />
                <FIELD NAME="data" TYPE="text" NOTNULL="true" />
                <FIELD NAME="ctime" TYPE="datetime" />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
                <KEY NAME="typefk" TYPE="foreign" FIELDS="type" REFTABLE="activity_type" REFFIELDS="name" />
            </KEYS>
        </TABLE>
185
186
        <!-- auth plugin tables -->
        <TABLE NAME="auth_config">
187
            <FIELDS>
188
189
                <FIELD NAME="plugin" TYPE="char" LENGTH="100" NOTNULL="true" />
                <FIELD NAME="field" TYPE="char" LENGTH="100" NOTNULL="true" />
190
                <FIELD NAME="value" TYPE="text" LENGTH="small" NOTNULL="true" />
191
192
            </FIELDS>
            <KEYS>
193
194
                <KEY NAME="primary" TYPE="primary" FIELDS="plugin,field" />
                <KEY NAME="pluginfk" TYPE="foreign" FIELDS="plugin" REFTABLE="auth_installed" REFFIELDS="name" />
195
196
            </KEYS>
        </TABLE>
197
198
199
200
201
202
203
204
205
206
207
        <TABLE NAME="auth_instance_config">
            <FIELDS>
	            <FIELD NAME="instance" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="field" TYPE="char" LENGTH="100" NOTNULL="true" />
                <FIELD NAME="value" TYPE="text" LENGTH="small" NOTNULL="true" />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="instance,field" />
                <KEY NAME="instancefk" TYPE="foreign" FIELDS="instance" REFTABLE="auth_instance" REFFIELDS="id" />
            </KEYS>
        </TABLE>
208
        <TABLE NAME="auth_cron">
209
            <FIELDS>
210
211
212
213
214
215
216
217
                <FIELD NAME="plugin" TYPE="char" LENGTH="255" NOTNULL="true" />
                <FIELD NAME="callfunction" TYPE="char" LENGTH="255" NOTNULL="true"  />
                <FIELD NAME="nextrun" TYPE="datetime" NOTNULL="false"  />
                <FIELD NAME="minute" TYPE="char" LENGTH="25" NOTNULL="true" DEFAULT="*"  />
                <FIELD NAME="hour" TYPE="char" LENGTH="25" NOTNULL="true" DEFAULT="*"  />
                <FIELD NAME="day" TYPE="char" LENGTH="25" NOTNULL="true" DEFAULT="*"  />
                <FIELD NAME="month" TYPE="char" LENGTH="25" NOTNULL="true" DEFAULT="*"  />
                <FIELD NAME="dayofweek" TYPE="char" LENGTH="25" NOTNULL="true" DEFAULT="*" />
218
219
            </FIELDS>
            <KEYS>
220
221
                <KEY NAME="primary" TYPE="primary" FIELDS="plugin,callfunction" />
                <KEY NAME="pluginfk" TYPE="foreign" FIELDS="plugin" REFTABLE="auth_installed" REFFIELDS="name" />
222
223
            </KEYS>
        </TABLE>
224
        <TABLE NAME="auth_event_subscription">
225
            <FIELDS>
226
227
228
229
                <FIELD NAME="id" TYPE="int" LENGTH="10" SEQUENCE="true"  NOTNULL="true" />
                <FIELD NAME="plugin" TYPE="char" LENGTH="255" NOTNULL="true" />
                <FIELD NAME="event" TYPE="char" LENGTH="50" NOTNULL="true" />
                <FIELD NAME="callfunction" TYPE="char" LENGTH="255" NOTNULL="true" />
230
231
            </FIELDS>
            <KEYS>
232
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
233
                <KEY NAME="pluginfk" TYPE="foreign" FIELDS="plugin" REFTABLE="auth_installed" REFFIELDS="name" />
Penny Leach's avatar
Penny Leach committed
234
                <KEY NAME="eventfk" TYPE="foreign" FIELDS="event" REFTABLE="event_type" REFFIELDS="name" />
235
                <KEY NAME="subscruk" TYPE="unique" FIELDS="plugin,event,callfunction" />
236
237
            </KEYS>
        </TABLE>
Penny Leach's avatar
Penny Leach committed
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
        <!-- notification plugin tables -->
        <TABLE NAME="notification_installed">
            <FIELDS> 
                <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" />
                <FIELD NAME="version" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="release" TYPE="text" LENGTH="small" NOTNULL="true" />
                <FIELD NAME="active" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1" />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="name" />
            </KEYS>
        </TABLE>
        <TABLE NAME="notification_config">
            <FIELDS>
                <FIELD NAME="plugin" TYPE="char" LENGTH="100" NOTNULL="true" />
                <FIELD NAME="field" TYPE="char" LENGTH="100" NOTNULL="true" />
                <FIELD NAME="value" TYPE="text" LENGTH="small" NOTNULL="true" />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="plugin,field" />
                <KEY NAME="pluginfk" TYPE="foreign" FIELDS="plugin" REFTABLE="notification_installed" REFFIELDS="name" />
            </KEYS>
        </TABLE>
        <TABLE NAME="notification_cron">
            <FIELDS>
                <FIELD NAME="plugin" TYPE="char" LENGTH="255" NOTNULL="true" />
                <FIELD NAME="callfunction" TYPE="char" LENGTH="255" NOTNULL="true"  />
                <FIELD NAME="nextrun" TYPE="datetime" NOTNULL="false"  />
                <FIELD NAME="minute" TYPE="char" LENGTH="25" NOTNULL="true" DEFAULT="*"  />
                <FIELD NAME="hour" TYPE="char" LENGTH="25" NOTNULL="true" DEFAULT="*"  />
                <FIELD NAME="day" TYPE="char" LENGTH="25" NOTNULL="true" DEFAULT="*"  />
                <FIELD NAME="month" TYPE="char" LENGTH="25" NOTNULL="true" DEFAULT="*"  />
                <FIELD NAME="dayofweek" TYPE="char" LENGTH="25" NOTNULL="true" DEFAULT="*" />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="plugin,callfunction" />
                <KEY NAME="pluginfk" TYPE="foreign" FIELDS="plugin" REFTABLE="notification_installed" REFFIELDS="name" />
            </KEYS>
        </TABLE>
        <TABLE NAME="notification_event_subscription">
            <FIELDS>
                <FIELD NAME="id" TYPE="int" LENGTH="10" SEQUENCE="true"  NOTNULL="true" />
                <FIELD NAME="plugin" TYPE="char" LENGTH="255" NOTNULL="true" />
                <FIELD NAME="event" TYPE="char" LENGTH="50" NOTNULL="true" />
                <FIELD NAME="callfunction" TYPE="char" LENGTH="255" NOTNULL="true" />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
                <KEY NAME="pluginfk" TYPE="foreign" FIELDS="plugin" REFTABLE="notification_installed" REFFIELDS="name" />
                <KEY NAME="eventfk" TYPE="foreign" FIELDS="event" REFTABLE="event_type" REFFIELDS="name" />
                <KEY NAME="subscruk" TYPE="unique" FIELDS="plugin,event,callfunction" />
            </KEYS>
        </TABLE>
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
        <!-- search plugin tables -->
        <TABLE NAME="search_installed">
            <FIELDS>
                <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" />
                <FIELD NAME="version" TYPE="int"  LENGTH="10" NOTNULL="true" />
                <FIELD NAME="release" TYPE="text" LENGTH="small" NOTNULL="true" />
                <FIELD NAME="active" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1" />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="name" />
            </KEYS>
        </TABLE>
        <TABLE NAME="search_config">
            <FIELDS>
                <FIELD NAME="plugin" TYPE="char" LENGTH="100" NOTNULL="true" />
                <FIELD NAME="field" TYPE="char" LENGTH="100" NOTNULL="true" />
                <FIELD NAME="value" TYPE="text" LENGTH="small" NOTNULL="true" />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="plugin,field" />
                <KEY NAME="pluginfk" TYPE="foreign" FIELDS="plugin" REFTABLE="search_installed" REFFIELDS="name" />
            </KEYS>
        </TABLE>
        <TABLE NAME="search_cron">
            <FIELDS>
                <FIELD NAME="plugin" TYPE="char" LENGTH="255" NOTNULL="true" />
                <FIELD NAME="callfunction" TYPE="char" LENGTH="255" NOTNULL="true"  />
                <FIELD NAME="nextrun" TYPE="datetime" NOTNULL="false"  />
                <FIELD NAME="minute" TYPE="char" LENGTH="25" NOTNULL="true" DEFAULT="*"  />
                <FIELD NAME="hour" TYPE="char" LENGTH="25" NOTNULL="true" DEFAULT="*"  />
                <FIELD NAME="day" TYPE="char" LENGTH="25" NOTNULL="true" DEFAULT="*"  />
                <FIELD NAME="month" TYPE="char" LENGTH="25" NOTNULL="true" DEFAULT="*"  />
                <FIELD NAME="dayofweek" TYPE="char" LENGTH="25" NOTNULL="true" DEFAULT="*" />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="plugin,callfunction" />
                <KEY NAME="pluginfk" TYPE="foreign" FIELDS="plugin" REFTABLE="search_installed" REFFIELDS="name" />
            </KEYS>
        </TABLE>
        <TABLE NAME="search_event_subscription">
            <FIELDS>
                <FIELD NAME="id" TYPE="int" LENGTH="10" SEQUENCE="true"  NOTNULL="true" />
                <FIELD NAME="plugin" TYPE="char" LENGTH="255" NOTNULL="true" />
                <FIELD NAME="event" TYPE="char" LENGTH="50" NOTNULL="true" />
                <FIELD NAME="callfunction" TYPE="char" LENGTH="255" NOTNULL="true" />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
                <KEY NAME="pluginfk" TYPE="foreign" FIELDS="plugin" REFTABLE="search_installed" REFFIELDS="name" />
                <KEY NAME="eventfk" TYPE="foreign" FIELDS="event" REFTABLE="event_type" REFFIELDS="name" />
                <KEY NAME="subscruk" TYPE="unique" FIELDS="plugin,event,callfunction" />
            </KEYS>
        </TABLE>
344
345
346
347
348
349
350
351
352
353
354
355
356
        <!-- artefact plugin tables -->
        <TABLE NAME="artefact_installed">
            <FIELDS> 
                <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" />
                <FIELD NAME="version" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="release" TYPE="text" LENGTH="small" NOTNULL="true" />
                <FIELD NAME="active" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1" />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="name" />
            </KEYS>
        </TABLE>
        <TABLE NAME="artefact_installed_type">
357
            <FIELDS>
358
359
                <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" />
                <FIELD NAME="plugin" TYPE="char" LENGTH="255" NOTNULL="true" />
360
361
            </FIELDS>
            <KEYS>
Martyn Smith's avatar
Martyn Smith committed
362
                <KEY NAME="primary" TYPE="primary" FIELDS="name" />
363
364
365
366
367
368
369
370
371
372
373
374
                <KEY NAME="pluginfk" TYPE="foreign" FIELDS="plugin" REFTABLE="artefact_installed" REFFIELDS="name" />
            </KEYS>
        </TABLE>
        <TABLE NAME="artefact_config">
            <FIELDS>
                <FIELD NAME="plugin" TYPE="char" LENGTH="100" NOTNULL="true" />
                <FIELD NAME="field" TYPE="char" LENGTH="100" NOTNULL="true" />
                <FIELD NAME="value" TYPE="text" LENGTH="small" NOTNULL="true" />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="plugin,field" />
                <KEY NAME="pluginfk" TYPE="foreign" FIELDS="plugin" REFTABLE="artefact_installed" REFFIELDS="name" />
375
376
            </KEYS>
        </TABLE>
377
        <TABLE NAME="artefact_cron">
378
            <FIELDS>
379
                <FIELD NAME="plugin" TYPE="char" LENGTH="255" NOTNULL="true" />
380
                <FIELD NAME="callfunction" TYPE="char" LENGTH="255" NOTNULL="true"  />
381
382
383
384
385
386
                <FIELD NAME="nextrun" TYPE="datetime" NOTNULL="false"  />
                <FIELD NAME="minute" TYPE="char" LENGTH="25" NOTNULL="true" DEFAULT="*"  />
                <FIELD NAME="hour" TYPE="char" LENGTH="25" NOTNULL="true" DEFAULT="*"  />
                <FIELD NAME="day" TYPE="char" LENGTH="25" NOTNULL="true" DEFAULT="*"  />
                <FIELD NAME="month" TYPE="char" LENGTH="25" NOTNULL="true" DEFAULT="*"  />
                <FIELD NAME="dayofweek" TYPE="char" LENGTH="25" NOTNULL="true" DEFAULT="*" />
387
388
            </FIELDS>
            <KEYS>
389
                <KEY NAME="primary" TYPE="primary" FIELDS="plugin,callfunction" />
390
                <KEY NAME="pluginfk" TYPE="foreign" FIELDS="plugin" REFTABLE="artefact_installed" REFFIELDS="name" />
391
392
            </KEYS>
        </TABLE>
393
        <TABLE NAME="artefact_event_subscription">
394
395
396
397
398
399
400
401
            <FIELDS>
                <FIELD NAME="id" TYPE="int" LENGTH="10" SEQUENCE="true"  NOTNULL="true" />
                <FIELD NAME="plugin" TYPE="char" LENGTH="255" NOTNULL="true" />
                <FIELD NAME="event" TYPE="char" LENGTH="50" NOTNULL="true" />
                <FIELD NAME="callfunction" TYPE="char" LENGTH="255" NOTNULL="true" />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
402
                <KEY NAME="pluginfk" TYPE="foreign" FIELDS="plugin" REFTABLE="artefact_installed" REFFIELDS="name" />
Penny Leach's avatar
Penny Leach committed
403
                <KEY NAME="eventfk" TYPE="foreign" FIELDS="event" REFTABLE="event_type" REFFIELDS="name" />
404
405
406
                <KEY NAME="subscruk" TYPE="unique" FIELDS="plugin,event,callfunction" />
            </KEYS>
        </TABLE>
Penny Leach's avatar
Penny Leach committed
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
        <!-- end of artefact plugin tables, back to core tables -->
        <TABLE NAME="artefact">
            <FIELDS>
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
                <FIELD NAME="artefacttype" TYPE="char" LENGTH="255" NOTNULL="true"  />
                <FIELD NAME="container" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0"  />
                <FIELD NAME="parent" TYPE="int" LENGTH="10" NOTNULL="false"  />
                <FIELD NAME="owner" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="ctime" TYPE="datetime" NOTNULL="true"  />
                <FIELD NAME="mtime" TYPE="datetime" NOTNULL="true"  />
                <FIELD NAME="atime" TYPE="datetime" NOTNULL="true"  />
                <FIELD NAME="locked" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0"  />
                <FIELD NAME="title" TYPE="text" NOTNULL="true"  />
                <FIELD NAME="description" TYPE="text" NOTNULL="false"  />
                <FIELD NAME="note" TYPE="text" NOTNULL="false" />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
Martyn Smith's avatar
Martyn Smith committed
425
                <KEY NAME="typefk" TYPE="foreign" FIELDS="artefacttype" REFTABLE="artefact_installed_type" REFFIELDS="name"  />
Penny Leach's avatar
Penny Leach committed
426
                <KEY NAME="parentfk" TYPE="foreign" FIELDS="parent" REFTABLE="artefact" REFFIELDS="id" />
427
                <KEY NAME="usrfk" TYPE="foreign" FIELDS="owner" REFTABLE="usr" REFFIELDS="id" />
Penny Leach's avatar
Penny Leach committed
428
429
            </KEYS>
        </TABLE>
430
431
432
433
434
435
436
437
438
439
        <TABLE NAME="artefact_tag">
            <FIELDS>
                <FIELD NAME="artefact" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="tag" TYPE="char" LENGTH="128" NOTNULL="true" />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="artefact,tag" />
                <KEY NAME="artefactfk" TYPE="foreign" FIELDS="artefact" REFTABLE="artefact" REFFIELDS="id" />
            </KEYS>
        </TABLE>
440
441
442
443
        <TABLE NAME="artefact_parent_cache">
            <FIELDS>
                <FIELD NAME="artefact" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="parent" TYPE="int" LENGTH="10" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
444
                <FIELD NAME="dirty" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
445
446
447
448
449
450
451
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="artefact,parent" />
                <KEY NAME="artefactfk" TYPE="foreign" FIELDS="artefact" REFTABLE="artefact" REFFIELDS="id" />
                <KEY NAME="parentfk" TYPE="foreign" FIELDS="parent" REFTABLE="artefact" REFFIELDS="id" />
            </KEYS>
        </TABLE>
Penny Leach's avatar
Penny Leach committed
452
453
454
        <TABLE NAME="community">
            <FIELDS>
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
455
                <FIELD NAME="name" TYPE="char" LENGTH="128" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
456
                <FIELD NAME="description" TYPE="text" NOTNULL="false" />
Penny Leach's avatar
Penny Leach committed
457
                <FIELD NAME="jointype" TYPE="char" LENGTH="20" NOTNULL="true" ENUM="true" ENUMVALUES="'controlled', 'invite', 'request', 'open'"  DEFAULT="open" />
Penny Leach's avatar
Penny Leach committed
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
                <FIELD NAME="owner" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" />
                <FIELD NAME="mtime" TYPE="datetime" NOTNULL="true" />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
                <KEY NAME="nameuk" TYPE="unique" FIELDS="name" />
                <KEY NAME="ownerfk" TYPE="foreign" FIELDS="owner" REFTABLE="usr" REFFIELDS="id" />
            </KEYS>
        </TABLE>
        <TABLE NAME="community_member">
            <FIELDS>
                <FIELD NAME="community" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="member" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" />
                <FIELD NAME="tutor" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="community,member" />
                <KEY NAME="communityfk" TYPE="foreign" FIELDS="community" REFTABLE="community" REFFIELDS="id" />
                <KEY NAME="memberfk" TYPE="foreign" FIELDS="member" REFTABLE="usr" REFFIELDS="id" />
            </KEYS>
        </TABLE>
        <TABLE NAME="community_member_request">
            <FIELDS>
                <FIELD NAME="community" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="member" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" />
                <FIELD NAME="reason" TYPE="text" NOTNULL="false" />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="community,member" />
                <KEY NAME="communityfk" TYPE="foreign" FIELDS="community" REFTABLE="community" REFFIELDS="id" />
                <KEY NAME="memberfk" TYPE="foreign" FIELDS="member" REFTABLE="usr" REFFIELDS="id" />
            </KEYS>
        </TABLE>
        <TABLE NAME="community_member_invite">
            <FIELDS>
                <FIELD NAME="community" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="member" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" />
                <FIELD NAME="reason" TYPE="text" NOTNULL="false" />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="community,member" />
                <KEY NAME="communityfk" TYPE="foreign" FIELDS="community" REFTABLE="community" REFFIELDS="id" />
                <KEY NAME="memberfk" TYPE="foreign" FIELDS="member" REFTABLE="usr" REFFIELDS="id" />
            </KEYS>
        </TABLE>
        <!-- user related tables -->
        <TABLE NAME="usr_group"> 
            <FIELDS>
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
                <FIELD NAME="name" TYPE="text" NOTNULL="true" />
                <FIELD NAME="owner" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="description" TYPE="text" NOTNULL="false" />
                <FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" />
                <FIELD NAME="mtime" TYPE="datetime" NOTNULL="true" />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
                <KEY NAME="ownerfk" TYPE="foreign" FIELDS="owner" REFTABLE="usr" REFFIELDS="id" />
            </KEYS>
        </TABLE>
        <TABLE NAME="usr_group_member">
            <FIELDS>
Martyn Smith's avatar
Martyn Smith committed
524
                <FIELD NAME="grp" TYPE="int" LENGTH="10" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
525
526
527
528
                <FIELD NAME="member" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" />
            </FIELDS>
            <KEYS>
Martyn Smith's avatar
Martyn Smith committed
529
530
                <KEY NAME="primary" TYPE="primary" FIELDS="grp,member" />
                <KEY NAME="grpfk" TYPE="foreign" FIELDS="grp" REFTABLE="usr_group" REFFIELDS="id" />
Penny Leach's avatar
Penny Leach committed
531
532
533
534
535
                <KEY NAME="memberfk" TYPE="foreign" FIELDS="member" REFTABLE="usr" REFFIELDS="id" />
            </KEYS>
        </TABLE>
        <TABLE NAME="usr_account_preference">
            <FIELDS>
Penny Leach's avatar
Penny Leach committed
536
                <FIELD NAME="usr" TYPE="int" LENGTH="10" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
537
538
539
540
                <FIELD NAME="field" TYPE="char" LENGTH="100" NOTNULL="true" />
                <FIELD NAME="value" TYPE="text" NOTNULL="true" />
            </FIELDS>
            <KEYS>
Penny Leach's avatar
Penny Leach committed
541
                <KEY NAME="primary" TYPE="primary" FIELDS="usr,field" />
542
                <KEY NAME="usrfk" TYPE="foreign" FIELDS="usr" REFTABLE="usr" REFFIELDS="id" />
Penny Leach's avatar
Penny Leach committed
543
544
545
546
            </KEYS>
        </TABLE>
        <TABLE NAME="usr_activity_preference">
            <FIELDS>
Penny Leach's avatar
Penny Leach committed
547
                <FIELD NAME="usr" TYPE="int" LENGTH="10" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
548
                <FIELD NAME="activity" TYPE="char" LENGTH="100" NOTNULL="true" />
549
                <FIELD NAME="method" TYPE="char" LENGTH="255" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
550
551
            </FIELDS>
            <KEYS>
Penny Leach's avatar
Penny Leach committed
552
                <KEY NAME="primary" TYPE="primary" FIELDS="usr,activity" />
553
                <KEY NAME="usrfk" TYPE="foreign" FIELDS="usr" REFTABLE="usr" REFFIELDS="id" />
Penny Leach's avatar
Penny Leach committed
554
555
556
557
558
559
                <KEY NAME="activityfk" TYPE="foreign" FIELDS="activity" REFTABLE="activity_type" REFFIELDS="name" />
                <KEY NAME="methodfk" TYPE="foreign" FIELDS="method" REFTABLE="notification_installed" REFFIELDS="name" />
            </KEYS>
        </TABLE>
        <TABLE NAME="usr_friend">
            <FIELDS>
560
561
                <FIELD NAME="usr1" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="usr2" TYPE="int" LENGTH="10" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
562
563
564
                <FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" />
            </FIELDS>
            <KEYS>
565
566
567
               <KEY NAME="primary" TYPE="primary" FIELDS="usr1,usr2" />
               <KEY NAME="usr1fk" TYPE="foreign" FIELDS="usr1" REFTABLE="usr" REFFIELDS="id" />
               <KEY NAME="usr2fk" TYPE="foreign" FIELDS="usr2" REFTABLE="usr" REFFIELDS="id" />
Penny Leach's avatar
Penny Leach committed
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
            </KEYS>
        </TABLE>
        <TABLE NAME="usr_friend_request">
            <FIELDS>
                <FIELD NAME="owner" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="requester" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" />
                <FIELD NAME="reason" TYPE="text" NOTNULL="false" />
            </FIELDS>
            <KEYS>
               <KEY NAME="primary" TYPE="primary" FIELDS="owner,requester" />
               <KEY NAME="ownerfk" TYPE="foreign" FIELDS="owner" REFTABLE="usr" REFFIELDS="id" />
               <KEY NAME="requesterfk" TYPE="foreign" FIELDS="requester" REFTABLE="usr" REFFIELDS="id" />
            </KEYS>
        </TABLE>
        <TABLE NAME="usr_registration">
            <FIELDS>
                <FIELD NAME="id" TYPE="int" LENGTH="10" SEQUENCE="true" NOTNULL="true" />
586
587
588
589
590
591
592
                <FIELD NAME="username" TYPE="char" LENGTH="30" NOTNULL="true"/>
                <FIELD NAME="password" TYPE="char" LENGTH="40" NOTNULL="true"/>
                <FIELD NAME="institution" TYPE="char" LENGTH="255" NOTNULL="true"/>
                <FIELD NAME="salt" TYPE="char" LENGTH="8" NOTNULL="true"/>
                <FIELD NAME="firstname" TYPE="text" NOTNULL="true"/>
                <FIELD NAME="lastname" TYPE="text" NOTNULL="true"/>
                <FIELD NAME="email" TYPE="text" NOTNULL="true"/>
593
594
                <FIELD NAME="key" TYPE="char" LENGTH="16" NOTNULL="true"/>
                <FIELD NAME="expiry" TYPE="datetime" NOTNULL="true"/>
Penny Leach's avatar
Penny Leach committed
595
596
597
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
598
                <KEY NAME="institution" TYPE="foreign" FIELDS="institution" REFTABLE="institution" REFFIELDS="name"/>
Penny Leach's avatar
Penny Leach committed
599
            </KEYS>
Richard Mansfield's avatar
Richard Mansfield committed
600
601
602
603
604
605
606
607
608
609
610
        </TABLE>
        <TABLE NAME="usr_infectedupload">
            <FIELDS>
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
                <FIELD NAME="usr" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="time" TYPE="datetime" NOTNULL="true"/>
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
                <KEY NAME="usrfk" TYPE="foreign" FIELDS="usr" REFTABLE="usr" REFFIELDS="id" />
            </KEYS>
Penny Leach's avatar
Penny Leach committed
611
612
613
        </TABLE>
        <TABLE NAME="usr_password_request">
            <FIELDS>
Penny Leach's avatar
Penny Leach committed
614
                <FIELD NAME="usr" TYPE="int" LENGTH="10" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
615
                <FIELD NAME="expiry" TYPE="datetime" NOTNULL="true" />
616
                <FIELD NAME="key" TYPE="char" LENGTH="20" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
617
618
            </FIELDS>
            <KEYS>
Penny Leach's avatar
Penny Leach committed
619
620
                <KEY NAME="primary" TYPE="primary" FIELDS="usr,expiry" />
                <KEY NAME="foreign" TYPE="foreign" FIELDS="usr" REFTABLE="usr" REFFIELDS="id" />
Penny Leach's avatar
Penny Leach committed
621
622
623
624
            </KEYS>         
        </TABLE>
        <TABLE NAME="template_category">
            <FIELDS>
625
626
                <FIELD NAME="name" TYPE="char" LENGTh="128" NOTNULL="true" />
                <FIELD NAME="parent" TYPE="char" LENGTH="128" NOTNULL="false" />
Penny Leach's avatar
Penny Leach committed
627
628
            </FIELDS>
            <KEYS>
629
630
                <KEY NAME="primary" TYPE="primary" FIELDS="name" />
                <KEY NAME="parentfk" TYPE="foreign" FIELDS="parent" REFTABLE="template_category" REFFIELDS="name" />
Penny Leach's avatar
Penny Leach committed
631
632
633
634
            </KEYS>
        </TABLE>
        <TABLE NAME="template">
            <FIELDS>
635
                <FIELD NAME="name" TYPE="char" LENGTH="128" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
636
637
                <FIELD NAME="title" TYPE="text" NOTNULL="true" />
                <FIELD NAME="description" TYPE="text" NOTNULL="false" />
638
                <FIELD NAME="category" TYPE="char" LENGTH="128" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
639
640
641
                <FIELD NAME="owner" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" />
                <FIELD NAME="mtime" TYPE="datetime" NOTNULL="true" />
642
643
                <FIELD NAME="cacheddata" TYPE="text" NOTNULL="false" />
                <FIELD NAME="deleted" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
Penny Leach's avatar
Penny Leach committed
644
                <FIELD NAME="thumbnail" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
Penny Leach's avatar
Penny Leach committed
645
646
            </FIELDS>
            <KEYS>
647
                <KEY NAME="primary" TYPE="primary" FIELDS="name" />
Penny Leach's avatar
Penny Leach committed
648
                <KEY NAME="ownerfk" TYPE="foreign" FIELDS="owner" REFTABLE="usr" REFFIELDS="id" />
649
                <KEY NAME="categoryfk" TYPE="foreign" FIELDS="category" REFTABLE="template_category" REFFIELDS="name" />
Penny Leach's avatar
Penny Leach committed
650
651
652
653
654
655
656
657
            </KEYS>
        </TABLE>
        <TABLE NAME="view">
            <FIELDS>
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
                <FIELD NAME="title" TYPE="text" NOTNULL="true" />
                <FIELD NAME="description" TYPE="text" NOTNULL="false" />
                <FIELD NAME="owner" TYPE="int" LENGTH="10" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
658
                <FIELD NAME="ownerformat" TYPE="text" NOTNULL="true" />
659
                <FIELD NAME="template" TYPE="char" LENGTH="128" NOTNULL="true" />
660
                <FIELD NAME="startdate" TYPE="datetime" />
Martyn Smith's avatar
Martyn Smith committed
661
                <FIELD NAME="stopdate" TYPE="datetime" />
Penny Leach's avatar
Penny Leach committed
662
663
                <FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" />
                <FIELD NAME="mtime" TYPE="datetime" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
664
                <FIELD NAME="atime" TYPE="datetime" NOTNULL="true" />
665
                <FIELD NAME="submittedto" TYPE="int" LENGTH="10" NOTNULL="false" />
Penny Leach's avatar
Penny Leach committed
666
667
668
669
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
                <KEY NAME="ownerfk" TYPE="foreign" FIELDS="owner" REFTABLE="usr" REFFIELDS="id" />
670
                <KEY NAME="templatefk" TYPE="foreign" FIELDS="template" REFTABLE="template" REFFIELDS="name" />
671
                <KEY NAME="submittedtofk" TYPE="foreign" FIELDS="submittedto" REFTABLE="community" REFFIELDS="id" />
Penny Leach's avatar
Penny Leach committed
672
673
            </KEYS>
        </TABLE>
674
675
676
677
678
679
680
681
682
683
        <TABLE NAME="view_tag">
            <FIELDS>
                <FIELD NAME="view" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="tag" TYPE="char" LENGTH="128" NOTNULL="true" />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="view,tag" />
                <KEY NAME="viewfk" TYPE="foreign" FIELDS="view" REFTABLE="view" REFFIELDS="id" />
            </KEYS>
        </TABLE>
Penny Leach's avatar
Penny Leach committed
684
685
686
687
688
689
690
        <TABLE NAME="view_artefact">
            <FIELDS>
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
                <FIELD NAME="view" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="artefact" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="block" TYPE="text" NOTNULL="true" />
                <FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
691
                <FIELD NAME="format" TYPE="text" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
                <KEY NAME="viewfk" TYPE="foreign" FIELDS="view" REFTABLE="view" REFFIELDS="id" />
                <KEY NAME="artefactfk" TYPE="foreign" FIELDS="artefact" REFTABLE="artefact" REFFIELDS="id" />
            </KEYS>
        </TABLE>
        <TABLE NAME="view_content">
            <FIELDS>
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
                <FIELD NAME="view" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="content" TYPE="text" NOTNULL="true" />
                <FIELD NAME="block" TYPE="text" NOTNULL="true" />
                <FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
                <KEY NAME="viewfk" TYPE="foreign" FIELDS="view" REFTABLE="view" REFFIELDS="id" />
            </KEYS>
        </TABLE>
Richard Mansfield's avatar
Richard Mansfield committed
712
713
        <TABLE NAME="view_feedback">
            <FIELDS>
714
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
Richard Mansfield's avatar
Richard Mansfield committed
715
716
                <FIELD NAME="view" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="author" TYPE="int" LENGTH="10" NOTNULL="true" />
717
                <FIELD NAME="message" TYPE="text" NOTNULL="true" />
Richard Mansfield's avatar
Richard Mansfield committed
718
719
720
721
722
723
724
725
726
727
728
                <FIELD NAME="attachment" TYPE="int" LENGTH="10" NOTNULL="false" />
                <FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" />
                <FIELD NAME="public" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
                <KEY NAME="viewfk" TYPE="foreign" FIELDS="view" REFTABLE="view" REFFIELDS="id" />
                <KEY NAME="authorfk" TYPE="foreign" FIELDS="author" REFTABLE="usr" REFFIELDS="id" />
                <KEY NAME="attachmentfk" TYPE="foreign" FIELDS="attachment" REFTABLE="artefact" REFFIELDS="id" />
            </KEYS>
        </TABLE>
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
        <TABLE NAME="artefact_feedback">
            <FIELDS>
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
                <FIELD NAME="artefact" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="view" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="author" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="message" TYPE="text" NOTNULL="false" />
                <FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" />
                <FIELD NAME="public" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
                <KEY NAME="artefactfk" TYPE="foreign" FIELDS="artefact" REFTABLE="artefact" REFFIELDS="id" />
                <KEY NAME="viewfk" TYPE="foreign" FIELDS="view" REFTABLE="view" REFFIELDS="id" />
                <KEY NAME="authorfk" TYPE="foreign" FIELDS="author" REFTABLE="usr" REFFIELDS="id" />
            </KEYS>
        </TABLE>
Martyn Smith's avatar
Martyn Smith committed
746
747
748
        <TABLE NAME="view_access">
            <FIELDS>
                <FIELD NAME="view" TYPE="int" LENGTH="10" NOTNULL="true" />
749
                <FIELD NAME="accesstype" TYPE="char" LENGTH="16" NOTNULL="true" ENUM="true" ENUMVALUES="'public', 'loggedin', 'friends'" DEFAULT="public" />
Martyn Smith's avatar
Martyn Smith committed
750
751
752
753
754
755
756
                <FIELD NAME="startdate" TYPE="datetime" NOTNULL="false" />
                <FIELD NAME="stopdate" TYPE="datetime" NOTNULL="false" />
            </FIELDS>
            <KEYS>
                <KEY NAME="viewfk" TYPE="foreign" FIELDS="view" REFTABLE="view" REFFIELDS="id" />
            </KEYS>
        </TABLE>
Penny Leach's avatar
Penny Leach committed
757
758
759
760
        <TABLE NAME="view_access_community">
            <FIELDS>
                <FIELD NAME="view" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="community" TYPE="int" LENGTH="10" NOTNULL="true" />
Martyn Smith's avatar
Martyn Smith committed
761
762
763
                <FIELD NAME="tutoronly" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
                <FIELD NAME="startdate" TYPE="datetime" NOTNULL="false" />
                <FIELD NAME="stopdate" TYPE="datetime" NOTNULL="false" />
Penny Leach's avatar
Penny Leach committed
764
765
766
767
768
769
770
771
772
            </FIELDS>
            <KEYS>
                <KEY NAME="viewfk" TYPE="foreign" FIELDS="view" REFTABLE="view" REFFIELDS="id" />
                <KEY NAME="communityfk" TYPE="foreign" FIELDS="community" REFTABLE="community" REFFIELDS="id" />
            </KEYS>
        </TABLE>
        <TABLE NAME="view_access_group">
            <FIELDS>
                <FIELD NAME="view" TYPE="int" LENGTH="10" NOTNULL="true" />
Martyn Smith's avatar
Martyn Smith committed
773
                <FIELD NAME="grp" TYPE="int" LENGTH="10" NOTNULL="true" />
Martyn Smith's avatar
Martyn Smith committed
774
775
                <FIELD NAME="startdate" TYPE="datetime" NOTNULL="false" />
                <FIELD NAME="stopdate" TYPE="datetime" NOTNULL="false" />
Penny Leach's avatar
Penny Leach committed
776
777
778
            </FIELDS>
            <KEYS>
                <KEY NAME="viewfk" TYPE="foreign" FIELDS="view" REFTABLE="view" REFFIELDS="id" />
Martyn Smith's avatar
Martyn Smith committed
779
                <KEY NAME="grpfk" TYPE="foreign" FIELDS="grp" REFTABLE="usr_group" REFFIELDS="id" />
Penny Leach's avatar
Penny Leach committed
780
781
            </KEYS>
        </TABLE>
782
        <TABLE NAME="view_access_usr">
Penny Leach's avatar
Penny Leach committed
783
784
            <FIELDS>
                <FIELD NAME="view" TYPE="int" LENGTH="10" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
785
                <FIELD NAME="usr" TYPE="int" LENGTH="10" NOTNULL="true" />
Martyn Smith's avatar
Martyn Smith committed
786
787
                <FIELD NAME="startdate" TYPE="datetime" NOTNULL="false" />
                <FIELD NAME="stopdate" TYPE="datetime" NOTNULL="false" />
Penny Leach's avatar
Penny Leach committed
788
789
790
            </FIELDS>
            <KEYS>
                <KEY NAME="viewfk" TYPE="foreign" FIELDS="view" REFTABLE="view" REFFIELDS="id" />
791
                <KEY NAME="usrfk" TYPE="foreign" FIELDS="usr" REFTABLE="usr" REFFIELDS="id" />
Penny Leach's avatar
Penny Leach committed
792
793
794
795
796
797
798
799
800
801
802
803
804
805
            </KEYS>
        </TABLE>
        <!-- site content stuff -->
        <!-- 
        <TABLE NAME="site_file">
        </TABLE>
        -->
        <TABLE NAME="site_menu">
            <FIELDS>
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
                <FIELD NAME="title" TYPE="text" NOTNULL="true" />
                <FIELD NAME="file" TYPE="int" LENGTH="10" NOTNULL="false" />
                <FIELD NAME="url" TYPE="text" NOTNULL="false" />
                <FIELD NAME="displayorder" TYPE="int" LENGTH="10" NOTNULL="true" />
806
                <FIELD NAME="public" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
Penny Leach's avatar
Penny Leach committed
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
                <!--- public? -->
                <!-- displayorder maybe should be the primary key -->
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
            <!--
                <KEY NAME="filefk" TYPE="foreign" FIELDS="file" REFTABLE="site_file" REFFIELDS="id" />
            -->
            </KEYS>
        </TABLE>
        <TABLE NAME="site_content"> 
            <FIELDS>
                <FIELD NAME="name" TYPE="char" LENGTH="50" NOTNULL="true" />
                <FIELD NAME="content" TYPE="text" NOTNULL="true" />
                <FIELD NAME="ctime" TYPE="datetime" NOTNOT="true" />
                <FIELD NAME="mtime" TYPE="datetime" NOTNULL="true" />
823
                <FIELD NAME="mauthor" TYPE="int" LENGTH="10" NOTNULL="false" />
Penny Leach's avatar
Penny Leach committed
824
825
826
827
828
829
830
831
832
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="name" />
                <KEY NAME="mauthorfk" TYPE="foreign" FIELDS="mauthor" REFTABLE="usr" REFFIELDS="id" />
            </KEYS>
        </TABLE>
        <!-- watchlist stuff -->
        <TABLE NAME="usr_watchlist_artefact">
            <FIELDS>
Penny Leach's avatar
Penny Leach committed
833
                <FIELD NAME="usr" TYPE="int" LENGTH="10" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
834
                <FIELD NAME="artefact" TYPE="int" LENGTH="10" NOTNULL="true" />
835
                <FIELD NAME="view" TYPE="int" LENGTH="10" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
836
                <FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" />
837
                <FIELD NAME="recurse" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1" />
838
                <FIELD NAME="deleted" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
Penny Leach's avatar
Penny Leach committed
839
840
            </FIELDS>
            <KEYS>
841
                <KEY NAME="primary" TYPE="primary" FIELDS="usr,artefact,view" />
842
                <KEY NAME="usrfk" TYPE="foreign" FIELDS="usr" REFTABLE="usr" REFFIELDS="id" />
Penny Leach's avatar
Penny Leach committed
843
                <KEY NAME="artefactfk" TYPE="foreign" FIELDS="artefact" REFTABLE="artefact" REFFIELDS="id" />
844
                <KEY NAME="viewfk" TYPE="foreign" FIELDS="view" REFTABLE="view" REFFIELDS="id" />
Penny Leach's avatar
Penny Leach committed
845
846
847
848
            </KEYS>
        </TABLE>
        <TABLE NAME="usr_watchlist_view">
            <FIELDS>
Penny Leach's avatar
Penny Leach committed
849
                <FIELD NAME="usr" TYPE="int" LENGTH="10" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
850
851
                <FIELD NAME="view" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
852
                <FIELD NAME="recurse" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1" />
Penny Leach's avatar
Penny Leach committed
853
854
            </FIELDS>
            <KEYS>
Penny Leach's avatar
Penny Leach committed
855
                <KEY NAME="primary" TYPE="primary" FIELDS="usr,view" />
856
                <KEY NAME="usrfk" TYPE="foreign" FIELDS="usr" REFTABLE="usr" REFFIELDS="id" />
Penny Leach's avatar
Penny Leach committed
857
858
859
860
861
                <KEY NAME="viewfk" TYPE="foreign" FIELDS="view" REFTABLE="view" REFFIELDS="id" />
            </KEYS>
        </TABLE>
        <TABLE NAME="usr_watchlist_community">
            <FIELDS>
Penny Leach's avatar
Penny Leach committed
862
                <FIELD NAME="usr" TYPE="int" LENGTH="10" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
863
864
865
866
                <FIELD NAME="community" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" />
            </FIELDS>
            <KEYS>
Penny Leach's avatar
Penny Leach committed
867
                <KEY NAME="primary" TYPE="primary" FIELDS="usr,community" />
868
                <KEY NAME="usrfk" TYPE="foreign" FIELDS="usr" REFTABLE="usr" REFFIELDS="id" />
Penny Leach's avatar
Penny Leach committed
869
870
871
                <KEY NAME="communityfk" TYPE="foreign" FIELDS="community" REFTABLE="community" REFFIELDS="id" />
            </KEYS>
        </TABLE>
872
    </TABLES>
873
    <STATEMENTS>
874
        <STATEMENT NAME="insert config" TYPE="insert" TABLE="config">
875
876
            <SENTENCES>
                <SENTENCE TEXT="(field, value) VALUES ('session_timeout', 1800)" />
877
                <SENTENCE TEXT="(field, value) VALUES ('sitename', 'Mahara')" />
878
                <SENTENCE TEXT="(field, value) VALUES ('pathtofile', '/usr/bin/file')" />
879
880
            </SENTENCES>
        </STATEMENT>
Penny Leach's avatar
Penny Leach committed
881
        <STATEMENT NAME="insert event types" TYPE="insert" TABLE="event_type">
882
883
884
885
            <SENTENCES>
                <SENTENCE TEXT="(name) VALUES ('createuser')" />
                <SENTENCE TEXT="(name) VALUES ('updateuser')" />
                <SENTENCE TEXT="(name) VALUES ('suspenduser')" />
886
                <SENTENCE TEXT="(name) VALUES ('unsuspenduser')" />
887
                <SENTENCE TEXT="(name) VALUES ('deleteuser')" />
888
889
890
891
892
                <SENTENCE TEXT="(name) VALUES ('undeleteuser')" />
                <SENTENCE TEXT="(name) VALUES ('expireuser')" />
                <SENTENCE TEXT="(name) VALUES ('unexpireuser')" />
                <SENTENCE TEXT="(name) VALUES ('deactivateuser')" />
                <SENTENCE TEXT="(name) VALUES ('activateuser')" />
893
894
                <SENTENCE TEXT="(name) VALUES ('saveartefact')" />
                <SENTENCE TEXT="(name) VALUES ('deleteartefact')" />
Martyn Smith's avatar
Martyn Smith committed
895
896
                <SENTENCE TEXT="(name) VALUES ('saveview')" />
                <SENTENCE TEXT="(name) VALUES ('deleteview')" />
897
            </SENTENCES>
898
        </STATEMENT>
Penny Leach's avatar
Penny Leach committed
899
900
        <STATEMENT NAME="insert activity types" TYPE="insert" TABLE="activity_type">
            <SENTENCES>
901
902
903
904
905
                <SENTENCE TEXT="(name, admin, delay) VALUES ('maharamessage', 0, 0)" />
                <SENTENCE TEXT="(name, admin, delay) VALUES ('usermessage', 0, 0)" />
                <SENTENCE TEXT="(name, admin, delay) VALUES ('feedback', 0, 0)" />
                <SENTENCE TEXT="(name, admin, delay) VALUES ('watchlist', 0, 1)" />
                <SENTENCE TEXT="(name, admin, delay) VALUES ('newview', 0, 1)" />
906
                <SENTENCE TEXT="(name, admin, delay) VALUES ('viewaccess', 0, 1)" />
907
908
909
910
                <SENTENCE TEXT="(name, admin, delay) VALUES ('contactus', 1, 1)" />
                <SENTENCE TEXT="(name, admin, delay) VALUES ('objectionable', 1, 1)" />
                <SENTENCE TEXT="(name, admin, delay) VALUES ('virusrepeat', 1, 1)" />
                <SENTENCE TEXT="(name, admin, delay) VALUES ('virusrelease', 1, 1)" />
Penny Leach's avatar
Penny Leach committed
911
912
            </SENTENCES>
        </STATEMENT>
913
914
915
        <STATEMENT NAME="insert core cron jobs" TYPE="insert" TABLE="cron">
            <SENTENCES>
                <SENTENCE TEXT="(callfunction, minute, hour, day, month, dayofweek) 
Nigel McNie's avatar
Nigel McNie committed
916
                        VALUES ('rebuild_artefact_parent_cache_dirty', '*', '*', '*', '*', '*')" />
917
                <SENTENCE TEXT="(callfunction, minute, hour, day, month, dayofweek) 
918
                        VALUES ('rebuild_artefact_parent_cache_complete', '0', '4', '*', '*', '*')" />
Nigel McNie's avatar
Nigel McNie committed
919
920
921
922
                <SENTENCE TEXT="(callfunction, minute, hour, day, month, dayofweek)
                        VALUES ('auth_clean_partial_registrations', '5', '0', '*', '*', '*')"/>
                <SENTENCE TEXT="(callfunction, minute, hour, day, month, dayofweek)
                        VALUES ('auth_handle_account_expiries', '5', '10', '*', '*', '*')"/>
923
924
925
                <SENTENCE TEXT="(callfunction, minute, hour, day, month, dayofweek)
                        VALUES ('activity_process_queue', '*/5', '*', '*', '*', '*')"/>
             </SENTENCES>
926
        </STATEMENT>
927
928
929
930
931
932
933
934
935
936
        <STATEMENT NAME="insert template categories" TYPE="insert" TABLE="template_category">
            <SENTENCES>
                <SENTENCE TEXT="(name) VALUES ('resume')" />
                <SENTENCE TEXT="(name) VALUES ('blog')" />
                <SENTENCE TEXT="(name) VALUES ('gallery')" />
                <SENTENCE TEXT="(name) VALUES ('academic')" />
                <SENTENCE TEXT="(name) VALUES ('professionaldevelopment')" />
                <SENTENCE TEXT="(name) VALUES ('personaldevelopment')" />
            </SENTANCES>
        </STATEMENT>
937
    </STATEMENTS>
938
</XMLDB>