install.xml 50.9 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
19
20
21
22
23
24
25
26
27
        <TABLE NAME="auth_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>
28
29
30
31
32
33
34
35
36
37
        <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>
38
39
        <TABLE NAME="institution">
            <FIELDS>
40
41
42
43
44
                <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true"/>
                <FIELD NAME="displayname" TYPE="char" LENGTH="255" NOTNULL="true"/>
                <FIELD NAME="authplugin" 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
51
52
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="name" />
                <KEY NAME="pluginfk" TYPE="foreign" FIELDS="authplugin" REFTABLE="auth_installed" REFFIELDS="name" />
            </KEYS>
53
54
55
56
57
58
59
60
61
62
        </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>
63
        </TABLE>
64
        <TABLE NAME="usr">
65
            <FIELDS>
66
67
68
                <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"/>
69
                <FIELD NAME="institution" TYPE="char" LENGTH="255" NOTNULL="true" DEFAULT="mahara"/>
70
71
                <FIELD NAME="salt" TYPE="char" LENGTH="8"/>
                <FIELD NAME="passwordchange" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0"/>
72
                <FIELD NAME="active" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1"/>
73
74
                <FIELD NAME="deleted" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0"/>
                <FIELD NAME="expiry" TYPE="datetime" NOTNULL="false"/>
75
                <FIELD NAME="expirymailsent" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0"/>
76
                <FIELD NAME="lastlogin" TYPE="datetime" NOTNULL="false"/>
77
                <FIELD NAME="inactivemailsent" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0"/>
78
79
80
81
82
83
84
                <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"/>
85
86
87
88
                <!-- 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
89
90
91
                <FIELD NAME="suspendedctime" TYPE="datetime" NOTNULL="false"/>
                <FIELD NAME="suspendedreason" TYPE="text" NOTNULL="false"/>
                <FIELD NAME="suspendedcusr" TYPE="int" LENGTH="10" NOTNULL="false"/>
92
93
                <FIELD NAME="quota" TYPE="int" LENGTH="10" NOTNULL="false"/>
                <FIELD NAME="quotaused" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" />
94
95
            </FIELDS>
            <KEYS>
96
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
97
                <KEY NAME="institution" TYPE="foreign" FIELDS="institution" REFTABLE="institution" REFFIELDS="name"/>
98
99
            </KEYS>
            <INDEXES>
Penny Leach's avatar
Penny Leach committed
100
                <INDEX NAME="usernameuk" UNIQUE="true" FIELDS="username,institution"/>
101
102
            </INDEXES>
        </TABLE>
Penny Leach's avatar
Penny Leach committed
103
        <TABLE NAME="event_type">
104
105
106
107
108
            <FIELDS>
                <FIELD NAME="name" TYPE="char" LENGTH="50" NOTNULL="true" />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="name" />
109
110
            </KEYS>
        </TABLE>
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
        <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>
132
133
134
135
136
137
138
139
140
141
142
143
        <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>
144
145
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
                <KEY NAME="callfunctionuk" TYPE="unique" FIELDS="callfunction" />
146
147
            </KEYS>
        </TABLE>
Penny Leach's avatar
Penny Leach committed
148
149
150
        <TABLE NAME="activity_type">
            <FIELDS>
                <FIELD NAME="name" TYPE="char" LENGTH="50" NOTNULL="true" />
151
                <FIELD NAME="admin" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
152
                <FIELD NAME="delay" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1" />
Penny Leach's avatar
Penny Leach committed
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
            </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>
170
171
        <!-- auth plugin tables -->
        <TABLE NAME="auth_config">
172
            <FIELDS>
173
174
                <FIELD NAME="plugin" TYPE="char" LENGTH="100" NOTNULL="true" />
                <FIELD NAME="field" TYPE="char" LENGTH="100" NOTNULL="true" />
175
                <FIELD NAME="value" TYPE="text" LENGTH="small" NOTNULL="true" />
176
177
            </FIELDS>
            <KEYS>
178
179
                <KEY NAME="primary" TYPE="primary" FIELDS="plugin,field" />
                <KEY NAME="pluginfk" TYPE="foreign" FIELDS="plugin" REFTABLE="auth_installed" REFFIELDS="name" />
180
181
            </KEYS>
        </TABLE>
182
        <TABLE NAME="auth_cron">
183
            <FIELDS>
184
185
186
187
188
189
190
191
                <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="*" />
192
193
            </FIELDS>
            <KEYS>
194
195
                <KEY NAME="primary" TYPE="primary" FIELDS="plugin,callfunction" />
                <KEY NAME="pluginfk" TYPE="foreign" FIELDS="plugin" REFTABLE="auth_installed" REFFIELDS="name" />
196
197
            </KEYS>
        </TABLE>
198
        <TABLE NAME="auth_event_subscription">
199
            <FIELDS>
200
201
202
203
                <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" />
204
205
            </FIELDS>
            <KEYS>
206
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
207
                <KEY NAME="pluginfk" TYPE="foreign" FIELDS="plugin" REFTABLE="auth_installed" REFFIELDS="name" />
Penny Leach's avatar
Penny Leach committed
208
                <KEY NAME="eventfk" TYPE="foreign" FIELDS="event" REFTABLE="event_type" REFFIELDS="name" />
209
                <KEY NAME="subscruk" TYPE="unique" FIELDS="plugin,event,callfunction" />
210
211
            </KEYS>
        </TABLE>
Penny Leach's avatar
Penny Leach committed
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
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
        <!-- 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>
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
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
        <!-- 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>
318
319
320
321
322
323
324
325
326
327
328
329
330
        <!-- 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">
331
            <FIELDS>
332
333
                <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" />
                <FIELD NAME="plugin" TYPE="char" LENGTH="255" NOTNULL="true" />
334
335
            </FIELDS>
            <KEYS>
Martyn Smith's avatar
Martyn Smith committed
336
                <KEY NAME="primary" TYPE="primary" FIELDS="name" />
337
338
339
340
341
342
343
344
345
346
347
348
                <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" />
349
350
            </KEYS>
        </TABLE>
351
        <TABLE NAME="artefact_cron">
352
            <FIELDS>
353
                <FIELD NAME="plugin" TYPE="char" LENGTH="255" NOTNULL="true" />
354
                <FIELD NAME="callfunction" TYPE="char" LENGTH="255" NOTNULL="true"  />
355
356
357
358
359
360
                <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="*" />
361
362
            </FIELDS>
            <KEYS>
363
                <KEY NAME="primary" TYPE="primary" FIELDS="plugin,callfunction" />
364
                <KEY NAME="pluginfk" TYPE="foreign" FIELDS="plugin" REFTABLE="artefact_installed" REFFIELDS="name" />
365
366
            </KEYS>
        </TABLE>
367
        <TABLE NAME="artefact_event_subscription">
368
369
370
371
372
373
374
375
            <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" />
376
                <KEY NAME="pluginfk" TYPE="foreign" FIELDS="plugin" REFTABLE="artefact_installed" REFFIELDS="name" />
Penny Leach's avatar
Penny Leach committed
377
                <KEY NAME="eventfk" TYPE="foreign" FIELDS="event" REFTABLE="event_type" REFFIELDS="name" />
378
379
380
                <KEY NAME="subscruk" TYPE="unique" FIELDS="plugin,event,callfunction" />
            </KEYS>
        </TABLE>
Penny Leach's avatar
Penny Leach committed
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
        <!-- 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
399
                <KEY NAME="typefk" TYPE="foreign" FIELDS="artefacttype" REFTABLE="artefact_installed_type" REFFIELDS="name"  />
Penny Leach's avatar
Penny Leach committed
400
                <KEY NAME="parentfk" TYPE="foreign" FIELDS="parent" REFTABLE="artefact" REFFIELDS="id" />
401
                <KEY NAME="usrfk" TYPE="foreign" FIELDS="owner" REFTABLE="usr" REFFIELDS="id" />
Penny Leach's avatar
Penny Leach committed
402
403
            </KEYS>
        </TABLE>
404
405
406
407
408
409
410
411
412
413
        <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>
414
415
416
417
        <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
418
                <FIELD NAME="dirty" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
419
420
421
422
423
424
425
            </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
426
427
428
        <TABLE NAME="community">
            <FIELDS>
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
429
                <FIELD NAME="name" TYPE="char" LENGTH="128" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
430
                <FIELD NAME="description" TYPE="text" NOTNULL="false" />
Penny Leach's avatar
Penny Leach committed
431
                <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
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
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
                <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
498
                <FIELD NAME="grp" TYPE="int" LENGTH="10" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
499
500
501
502
                <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
503
504
                <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
505
506
507
508
509
                <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
510
                <FIELD NAME="usr" TYPE="int" LENGTH="10" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
511
512
513
514
                <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
515
                <KEY NAME="primary" TYPE="primary" FIELDS="usr,field" />
516
                <KEY NAME="usrfk" TYPE="foreign" FIELDS="usr" REFTABLE="usr" REFFIELDS="id" />
Penny Leach's avatar
Penny Leach committed
517
518
519
520
            </KEYS>
        </TABLE>
        <TABLE NAME="usr_activity_preference">
            <FIELDS>
Penny Leach's avatar
Penny Leach committed
521
                <FIELD NAME="usr" TYPE="int" LENGTH="10" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
522
                <FIELD NAME="activity" TYPE="char" LENGTH="100" NOTNULL="true" />
523
                <FIELD NAME="method" TYPE="char" LENGTH="255" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
524
525
            </FIELDS>
            <KEYS>
Penny Leach's avatar
Penny Leach committed
526
                <KEY NAME="primary" TYPE="primary" FIELDS="usr,activity" />
527
                <KEY NAME="usrfk" TYPE="foreign" FIELDS="usr" REFTABLE="usr" REFFIELDS="id" />
Penny Leach's avatar
Penny Leach committed
528
529
530
531
532
533
                <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>
534
535
                <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
536
537
538
                <FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" />
            </FIELDS>
            <KEYS>
539
540
541
               <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
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
            </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" />
560
561
562
563
564
565
566
                <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"/>
567
568
                <FIELD NAME="key" TYPE="char" LENGTH="16" NOTNULL="true"/>
                <FIELD NAME="expiry" TYPE="datetime" NOTNULL="true"/>
Penny Leach's avatar
Penny Leach committed
569
570
571
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
572
                <KEY NAME="institution" TYPE="foreign" FIELDS="institution" REFTABLE="institution" REFFIELDS="name"/>
Penny Leach's avatar
Penny Leach committed
573
            </KEYS>
Richard Mansfield's avatar
Richard Mansfield committed
574
575
576
577
578
579
580
581
582
583
584
        </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
585
586
587
        </TABLE>
        <TABLE NAME="usr_password_request">
            <FIELDS>
Penny Leach's avatar
Penny Leach committed
588
                <FIELD NAME="usr" TYPE="int" LENGTH="10" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
589
                <FIELD NAME="expiry" TYPE="datetime" NOTNULL="true" />
590
                <FIELD NAME="key" TYPE="char" LENGTH="20" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
591
592
            </FIELDS>
            <KEYS>
Penny Leach's avatar
Penny Leach committed
593
594
                <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
595
596
597
598
            </KEYS>         
        </TABLE>
        <TABLE NAME="template_category">
            <FIELDS>
599
600
                <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
601
602
            </FIELDS>
            <KEYS>
603
604
                <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
605
606
607
608
            </KEYS>
        </TABLE>
        <TABLE NAME="template">
            <FIELDS>
609
                <FIELD NAME="name" TYPE="char" LENGTH="128" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
610
611
                <FIELD NAME="title" TYPE="text" NOTNULL="true" />
                <FIELD NAME="description" TYPE="text" NOTNULL="false" />
612
                <FIELD NAME="category" TYPE="char" LENGTH="128" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
613
614
615
                <FIELD NAME="owner" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" />
                <FIELD NAME="mtime" TYPE="datetime" NOTNULL="true" />
616
617
                <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
618
                <FIELD NAME="thumbnail" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
Penny Leach's avatar
Penny Leach committed
619
620
            </FIELDS>
            <KEYS>
621
                <KEY NAME="primary" TYPE="primary" FIELDS="name" />
Penny Leach's avatar
Penny Leach committed
622
                <KEY NAME="ownerfk" TYPE="foreign" FIELDS="owner" REFTABLE="usr" REFFIELDS="id" />
623
                <KEY NAME="categoryfk" TYPE="foreign" FIELDS="category" REFTABLE="template_category" REFFIELDS="name" />
Penny Leach's avatar
Penny Leach committed
624
625
626
627
628
629
630
631
            </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
632
                <FIELD NAME="ownerformat" TYPE="text" NOTNULL="true" />
633
                <FIELD NAME="template" TYPE="char" LENGTH="128" NOTNULL="true" />
634
                <FIELD NAME="startdate" TYPE="datetime" />
Martyn Smith's avatar
Martyn Smith committed
635
                <FIELD NAME="stopdate" TYPE="datetime" />
Penny Leach's avatar
Penny Leach committed
636
637
                <FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" />
                <FIELD NAME="mtime" TYPE="datetime" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
638
                <FIELD NAME="atime" TYPE="datetime" NOTNULL="true" />
639
                <FIELD NAME="submittedto" TYPE="int" LENGTH="10" NOTNULL="false" />
Penny Leach's avatar
Penny Leach committed
640
641
642
643
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
                <KEY NAME="ownerfk" TYPE="foreign" FIELDS="owner" REFTABLE="usr" REFFIELDS="id" />
644
                <KEY NAME="templatefk" TYPE="foreign" FIELDS="template" REFTABLE="template" REFFIELDS="name" />
645
                <KEY NAME="submittedtofk" TYPE="foreign" FIELDS="submittedto" REFTABLE="community" REFFIELDS="id" />
Penny Leach's avatar
Penny Leach committed
646
647
            </KEYS>
        </TABLE>
648
649
650
651
652
653
654
655
656
657
        <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
658
659
660
661
662
663
664
        <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
665
                <FIELD NAME="format" TYPE="text" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
            </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
686
687
        <TABLE NAME="view_feedback">
            <FIELDS>
688
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
Richard Mansfield's avatar
Richard Mansfield committed
689
690
                <FIELD NAME="view" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="author" TYPE="int" LENGTH="10" NOTNULL="true" />
691
                <FIELD NAME="message" TYPE="text" NOTNULL="true" />
Richard Mansfield's avatar
Richard Mansfield committed
692
693
694
695
696
697
698
699
700
701
702
                <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>
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
        <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
720
721
722
        <TABLE NAME="view_access">
            <FIELDS>
                <FIELD NAME="view" TYPE="int" LENGTH="10" NOTNULL="true" />
723
                <FIELD NAME="accesstype" TYPE="char" LENGTH="16" NOTNULL="true" ENUM="true" ENUMVALUES="'public', 'loggedin', 'friends'" DEFAULT="public" />
Martyn Smith's avatar
Martyn Smith committed
724
725
726
727
728
729
730
                <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
731
732
733
734
        <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
735
736
737
                <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
738
739
740
741
742
743
744
745
746
            </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
747
                <FIELD NAME="grp" TYPE="int" LENGTH="10" NOTNULL="true" />
Martyn Smith's avatar
Martyn Smith committed
748
749
                <FIELD NAME="startdate" TYPE="datetime" NOTNULL="false" />
                <FIELD NAME="stopdate" TYPE="datetime" NOTNULL="false" />
Penny Leach's avatar
Penny Leach committed
750
751
752
            </FIELDS>
            <KEYS>
                <KEY NAME="viewfk" TYPE="foreign" FIELDS="view" REFTABLE="view" REFFIELDS="id" />
Martyn Smith's avatar
Martyn Smith committed
753
                <KEY NAME="grpfk" TYPE="foreign" FIELDS="grp" REFTABLE="usr_group" REFFIELDS="id" />
Penny Leach's avatar
Penny Leach committed
754
755
            </KEYS>
        </TABLE>
756
        <TABLE NAME="view_access_usr">
Penny Leach's avatar
Penny Leach committed
757
758
            <FIELDS>
                <FIELD NAME="view" TYPE="int" LENGTH="10" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
759
                <FIELD NAME="usr" TYPE="int" LENGTH="10" NOTNULL="true" />
Martyn Smith's avatar
Martyn Smith committed
760
761
                <FIELD NAME="startdate" TYPE="datetime" NOTNULL="false" />
                <FIELD NAME="stopdate" TYPE="datetime" NOTNULL="false" />
Penny Leach's avatar
Penny Leach committed
762
763
764
            </FIELDS>
            <KEYS>
                <KEY NAME="viewfk" TYPE="foreign" FIELDS="view" REFTABLE="view" REFFIELDS="id" />
765
                <KEY NAME="usrfk" TYPE="foreign" FIELDS="usr" REFTABLE="usr" REFFIELDS="id" />
Penny Leach's avatar
Penny Leach committed
766
767
768
769
770
771
772
773
774
775
776
777
778
779
            </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" />
780
                <FIELD NAME="public" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
Penny Leach's avatar
Penny Leach committed
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
                <!--- 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" />
797
                <FIELD NAME="mauthor" TYPE="int" LENGTH="10" NOTNULL="false" />
Penny Leach's avatar
Penny Leach committed
798
799
800
801
802
803
804
805
806
            </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
807
                <FIELD NAME="usr" TYPE="int" LENGTH="10" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
808
                <FIELD NAME="artefact" TYPE="int" LENGTH="10" NOTNULL="true" />
809
                <FIELD NAME="view" TYPE="int" LENGTH="10" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
810
                <FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" />
811
                <FIELD NAME="recurse" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1" />
812
                <FIELD NAME="deleted" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
Penny Leach's avatar
Penny Leach committed
813
814
            </FIELDS>
            <KEYS>
815
                <KEY NAME="primary" TYPE="primary" FIELDS="usr,artefact,view" />
816
                <KEY NAME="usrfk" TYPE="foreign" FIELDS="usr" REFTABLE="usr" REFFIELDS="id" />
Penny Leach's avatar
Penny Leach committed
817
                <KEY NAME="artefactfk" TYPE="foreign" FIELDS="artefact" REFTABLE="artefact" REFFIELDS="id" />
818
                <KEY NAME="viewfk" TYPE="foreign" FIELDS="view" REFTABLE="view" REFFIELDS="id" />
Penny Leach's avatar
Penny Leach committed
819
820
821
822
            </KEYS>
        </TABLE>
        <TABLE NAME="usr_watchlist_view">
            <FIELDS>
Penny Leach's avatar
Penny Leach committed
823
                <FIELD NAME="usr" TYPE="int" LENGTH="10" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
824
825
                <FIELD NAME="view" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
826
                <FIELD NAME="recurse" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1" />
Penny Leach's avatar
Penny Leach committed
827
828
            </FIELDS>
            <KEYS>
Penny Leach's avatar
Penny Leach committed
829
                <KEY NAME="primary" TYPE="primary" FIELDS="usr,view" />
830
                <KEY NAME="usrfk" TYPE="foreign" FIELDS="usr" REFTABLE="usr" REFFIELDS="id" />
Penny Leach's avatar
Penny Leach committed
831
832
833
834
835
                <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
836
                <FIELD NAME="usr" TYPE="int" LENGTH="10" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
837
838
839
840
                <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
841
                <KEY NAME="primary" TYPE="primary" FIELDS="usr,community" />
842
                <KEY NAME="usrfk" TYPE="foreign" FIELDS="usr" REFTABLE="usr" REFFIELDS="id" />
Penny Leach's avatar
Penny Leach committed
843
844
845
                <KEY NAME="communityfk" TYPE="foreign" FIELDS="community" REFTABLE="community" REFFIELDS="id" />
            </KEYS>
        </TABLE>
846
    </TABLES>
847
    <STATEMENTS>
848
        <STATEMENT NAME="insert config" TYPE="insert" TABLE="config">
849
850
            <SENTENCES>
                <SENTENCE TEXT="(field, value) VALUES ('session_timeout', 1800)" />
851
                <SENTENCE TEXT="(field, value) VALUES ('sitename', 'Mahara')" />
852
                <SENTENCE TEXT="(field, value) VALUES ('pathtofile', '/usr/bin/file')" />
853
854
            </SENTENCES>
        </STATEMENT>
Penny Leach's avatar
Penny Leach committed
855
        <STATEMENT NAME="insert event types" TYPE="insert" TABLE="event_type">
856
857
858
859
            <SENTENCES>
                <SENTENCE TEXT="(name) VALUES ('createuser')" />
                <SENTENCE TEXT="(name) VALUES ('updateuser')" />
                <SENTENCE TEXT="(name) VALUES ('suspenduser')" />
860
                <SENTENCE TEXT="(name) VALUES ('unsuspenduser')" />
861
                <SENTENCE TEXT="(name) VALUES ('deleteuser')" />
862
863
864
865
866
                <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')" />
867
868
                <SENTENCE TEXT="(name) VALUES ('saveartefact')" />
                <SENTENCE TEXT="(name) VALUES ('deleteartefact')" />
Martyn Smith's avatar
Martyn Smith committed
869
870
                <SENTENCE TEXT="(name) VALUES ('saveview')" />
                <SENTENCE TEXT="(name) VALUES ('deleteview')" />
871
            </SENTENCES>
872
        </STATEMENT>
Penny Leach's avatar
Penny Leach committed
873
874
        <STATEMENT NAME="insert activity types" TYPE="insert" TABLE="activity_type">
            <SENTENCES>
875
876
877
878
879
                <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)" />
880
                <SENTENCE TEXT="(name, admin, delay) VALUES ('viewaccess', 0, 1)" />
881
882
883
884
                <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
885
886
            </SENTENCES>
        </STATEMENT>
887
888
889
        <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
890
                        VALUES ('rebuild_artefact_parent_cache_dirty', '*', '*', '*', '*', '*')" />
891
                <SENTENCE TEXT="(callfunction, minute, hour, day, month, dayofweek) 
892
                        VALUES ('rebuild_artefact_parent_cache_complete', '0', '4', '*', '*', '*')" />
Nigel McNie's avatar
Nigel McNie committed
893
894
895
896
                <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', '*', '*', '*')"/>
897
898
899
                <SENTENCE TEXT="(callfunction, minute, hour, day, month, dayofweek)
                        VALUES ('activity_process_queue', '*/5', '*', '*', '*', '*')"/>
             </SENTENCES>
900
        </STATEMENT>
901
902
903
904
905
906
907
908
909
910
        <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>
911
    </STATEMENTS>
912
</XMLDB>