install.xml 76.8 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
                <FIELD NAME="field" TYPE="char" LENGTH="255" NOTNULL="true"/>
11
                <FIELD NAME="value" TYPE="text" LENGTH="small" NOTNULL="false"/>
12
13
            </FIELDS>
            <KEYS>
14
                <KEY NAME="primary" TYPE="primary" FIELDS="field" />
15
16
            </KEYS>
        </TABLE>
17
        <TABLE NAME="event_type">
18
            <FIELDS>
19
                <FIELD NAME="name" TYPE="char" LENGTH="50" NOTNULL="true" />
20
21
            </FIELDS>
            <KEYS>
Donal McMullan's avatar
Donal McMullan committed
22
                <KEY NAME="primary" TYPE="primary" FIELDS="name" />
23
24
            </KEYS>
        </TABLE>
25
26
27
28
29
30
31
32
33
34
35
36
        <TABLE NAME="event_subscription">
            <FIELDS>
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="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="eventfk" TYPE="foreign" FIELDS="event" REFTABLE="event_type" REFFIELDS="name" />
                <KEY NAME="subscruk" TYPE="unique" FIELDS="event,callfunction" />
            </KEYS>
        </TABLE>
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
        <TABLE NAME="style">
            <FIELDS>
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
                <FIELD NAME="title" TYPE="char" LENGTH="255" NOTNULL="true"/>
                <FIELD NAME="css" TYPE="text" NOTNULL="false"/>
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
            </KEYS>
        </TABLE>
        <TABLE NAME="style_property">
            <FIELDS>
                <FIELD NAME="style" 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="style,field" />
                <KEY NAME="stylefk" TYPE="foreign" FIELDS="style" REFTABLE="style" REFFIELDS="id"/>
            </KEYS>
        </TABLE>
58
59
        <TABLE NAME="institution">
            <FIELDS>
60
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
61
62
                <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true"/>
                <FIELD NAME="displayname" TYPE="char" LENGTH="255" NOTNULL="true"/>
63
                <FIELD NAME="registerallowed" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0"/>
64
                <FIELD NAME="theme" TYPE="char" LENGTH="255" NOTNULL="false"/>
65
                <FIELD NAME="defaultmembershipperiod" TYPE="int" NOTNULL="false" />
66
                <FIELD NAME="maxuseraccounts" TYPE="int" NOTNULL="false" />
67
68
69
                <FIELD NAME="expiry" TYPE="datetime" NOTNULL="false" />
                <FIELD NAME="expirymailsent" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0"/>
                <FIELD NAME="suspended" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0"/>
70
                <FIELD NAME="priority" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="1"/>
71
                <FIELD NAME="defaultquota" TYPE="int" LENGTH="10" NOTNULL="false"/>
72
                <FIELD NAME="showonlineusers" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="2"/>
73
                <FIELD NAME="allowinstitutionpublicviews" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0"/>
74
                <FIELD NAME="registerconfirm" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1"/>
75
76
77
78
79
                <!-- 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. The foreign key will be created
                during the postinst phase. -->
                <FIELD NAME="logo" TYPE="int" LENGTH="10" NOTNULL="false"/>
80
                <FIELD NAME="style" TYPE="int" LENGTH="10" NOTNULL="false"/>
81
82
                <FIELD NAME="licensemandatory" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0"/>
                <FIELD NAME="licensedefault" TYPE="char" LENGTH="255" NOTNULL="false"/>
83
                <FIELD NAME="dropdownmenu" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0"/>
84
                <FIELD NAME="skins" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1"/>
85
86
87
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="name" />
88
                <KEY NAME="inst_id_uk" TYPE="unique" FIELDS="id"/>
89
                <KEY NAME="stylefk" TYPE="foreign" FIELDS="style" REFTABLE="style" REFFIELDS="id"/>
90
91
            </KEYS>
        </TABLE>
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
        <TABLE NAME="institution_config">
            <FIELDS>
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
                <FIELD NAME="institution" TYPE="char" LENGTH="255" NOTNULL="true" />
                <FIELD NAME="field" TYPE="char" LENGTH="255" NOTNULL="true" />
                <FIELD NAME="value" TYPE="text" LENGTH="small" NOTNULL="false" />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
                <KEY NAME="institutionfk" TYPE="foreign" FIELDS="institution" REFTABLE="institution" REFFIELDS="name" />
            </KEYS>
            <INDEXES>
                <INDEX NAME="instfielduk" UNIQUE="true" FIELDS="institution,field"/>
            </INDEXES>
        </TABLE>
107
108
109
110
111
112
113
        <!-- PLUGIN_TYPE_SUBSTITUTION -->
        <TABLE NAME="application">
            <FIELDS>
                <FIELD NAME="name" TYPE="char" LENGTH="20" NOTNULL="true" />
                <FIELD NAME="displayname" TYPE="char" LENGTH="100" NOTNULL="true" />
                <FIELD NAME="xmlrpcserverurl" TYPE="char" LENGTH="255" NOTNULL="true" />
                <FIELD NAME="ssolandurl" TYPE="char" LENGTH="255" NOTNULL="true" />
114
115
            </FIELDS>
            <KEYS>
116
                <KEY NAME="primary" TYPE="primary" FIELDS="name" />
117
            </KEYS>
118
119
120
121
122
123
124
125
126
127
        </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>
128
        </TABLE>
129
        <TABLE NAME="usr">
130
            <FIELDS>
131
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
132
                <FIELD NAME="username" TYPE="char" LENGTH="255" NOTNULL="true"/>
133
                <FIELD NAME="password" TYPE="char" LENGTH="255" NOTNULL="true"/>
134
                <FIELD NAME="salt" TYPE="char" LENGTH="8" NOTNULL="false"/>
135
                <FIELD NAME="passwordchange" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0"/>
136
                <FIELD NAME="active" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1"/>
137
138
                <FIELD NAME="deleted" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0"/>
                <FIELD NAME="expiry" TYPE="datetime" NOTNULL="false"/>
139
                <FIELD NAME="expirymailsent" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0"/>
140
                <FIELD NAME="lastlogin" TYPE="datetime" NOTNULL="false"/>
141
                <FIELD NAME="lastlastlogin" TYPE="datetime" NOTNULL="false"/>
142
                <FIELD NAME="lastaccess" TYPE="datetime" NOTNULL="false"/>
143
                <FIELD NAME="inactivemailsent" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0"/>
144
145
146
147
148
149
                <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"/>
150
                <FIELD NAME="email" TYPE="char" LENGTH="255" NOTNULL="false"/>
151
152
                <!-- 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
153
154
                to create the tables first, then the keys. The foreign key will be created
                during the postinst phase. -->
155
                <FIELD NAME="profileicon" TYPE="int" LENGTH="10" NOTNULL="false"/>
Nigel McNie's avatar
Nigel McNie committed
156
157
158
                <FIELD NAME="suspendedctime" TYPE="datetime" NOTNULL="false"/>
                <FIELD NAME="suspendedreason" TYPE="text" NOTNULL="false"/>
                <FIELD NAME="suspendedcusr" TYPE="int" LENGTH="10" NOTNULL="false"/>
159
160
                <FIELD NAME="quota" TYPE="int" LENGTH="10" NOTNULL="false"/>
                <FIELD NAME="quotaused" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" />
161
                <FIELD NAME="authinstance" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="1" />
Richard Mansfield's avatar
Richard Mansfield committed
162
                <FIELD NAME="ctime" TYPE="datetime" NOTNULL="false" />
163
                <FIELD NAME="showhomeinfo" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1" />
164
                <FIELD NAME="logintries" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
165
                <FIELD NAME="unread" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" />
166
                <FIELD NAME="urlid" TYPE="char" LENGTH="30" NOTNULL="false" />
167
                <FIELD NAME="probation" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" />
168
169
170
                <!-- If adding a datetime column, you should also update the relevant
                functions in htdocs/auth/user.php and htdocs/lib/user.php to convert the
                value to a timestamp when a record is retrieved -->
171
172
            </FIELDS>
            <KEYS>
173
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
174
                <KEY NAME="authinstancefk" TYPE="foreign" FIELDS="authinstance" REFTABLE="auth_instance" REFFIELDS="id" />
175
176
            </KEYS>
            <INDEXES>
177
                <INDEX NAME="usernameuk" UNIQUE="true" FIELDS="username"/>
178
                <INDEX NAME="urliduk" UNIQUE="true" FIELDS="urlid" />
179
180
            </INDEXES>
        </TABLE>
181
182
183
184
185
186
        <TABLE NAME="usr_institution">
            <FIELDS>
                <FIELD NAME="usr" TYPE="int" LENGTH="10" NOTNULL="true"/>
                <FIELD NAME="institution" TYPE="char" LENGTH="255" NOTNULL="true" />
                <FIELD NAME="ctime" TYPE="datetime" NOTNULL="false"/>
                <FIELD NAME="expiry" TYPE="datetime" NOTNULL="false"/>
187
                <FIELD NAME="expirymailsent" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0"/>
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
                <FIELD NAME="studentid" TYPE="text" NOTNULL="false"/>
                <FIELD NAME="staff" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0"/>
                <FIELD NAME="admin" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0"/>
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="usr,institution" />
                <KEY NAME="usr" TYPE="foreign" FIELDS="usr" REFTABLE="usr" REFFIELDS="id"/>
                <KEY NAME="institution" TYPE="foreign" FIELDS="institution" REFTABLE="institution" REFFIELDS="name"/>
            </KEYS>
        </TABLE>
        <TABLE NAME="usr_institution_request">
            <FIELDS>
                <FIELD NAME="usr" TYPE="int" LENGTH="10" NOTNULL="true"/>
                <FIELD NAME="institution" TYPE="char" LENGTH="255" NOTNULL="true" />
                <FIELD NAME="confirmedusr" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
                <FIELD NAME="confirmedinstitution" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
                <FIELD NAME="ctime" TYPE="datetime" NOTNULL="false"/>
                <FIELD NAME="studentid" TYPE="text" NOTNULL="false"/>
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="usr,institution" />
                <KEY NAME="usr" TYPE="foreign" FIELDS="usr" REFTABLE="usr" REFFIELDS="id"/>
                <KEY NAME="institution" TYPE="foreign" FIELDS="institution" REFTABLE="institution" REFFIELDS="name"/>
            </KEYS>
        </TABLE>
213
214
215
216
217
218
219
220
221
222
223
        <TABLE NAME="usr_login_data">
            <FIELDS>
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
                <FIELD NAME="usr" TYPE="int" LENGTH="10" NOTNULL="true"/>
                <FIELD NAME="ctime" TYPE="datetime" NOTNULL="true"/>
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
                <KEY NAME="usr" TYPE="foreign" FIELDS="usr" REFTABLE="usr" REFFIELDS="id"/>
            </KEYS>
        </TABLE>
224
225
226
227
228
229
230
231
232
233
234
235
236
        <TABLE NAME="usr_session">
            <FIELDS>
                <FIELD NAME="usr" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="session" TYPE="char" LENGTH="255" NOTNULL="true" />
                <FIELD NAME="ctime" TYPE="datetime" NOTNULL="true"/>
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="session" />
            </KEYS>
            <INDEXES>
                <INDEX NAME="usrix" UNIQUE="false" FIELDS="usr"/>
            </INDEXES>
        </TABLE>
Hugh Davenport's avatar
Hugh Davenport committed
237
238
239
240
241
242
243
244
245
246
        <TABLE NAME="usr_tag">
            <FIELDS>
                <FIELD NAME="usr" TYPE="int" LENGTH="10" NOTNULL="true"/>
                <FIELD NAME="tag" TYPE="char" LENGTH="128" NOTNULL="true"/>
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="usr,tag"/>
                <KEY NAME="usrfk" TYPE="foreign" FIELDS="usr" REFTABLE="usr" REFFIELDS="id"/>
            </KEYS>
        </TABLE>
247
248
249
250
251
252
253
254
255
256
257
258
        <TABLE NAME="auth_remote_user">
            <FIELDS>
                <FIELD NAME="authinstance" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="remoteusername" TYPE="char" LENGTH="255" NOTNULL="true" />
                <FIELD NAME="localusr" TYPE="int" LENGTH="10" NOTNULL="true" />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="authinstance,remoteusername" />
                <KEY NAME="authinstancefk" TYPE="foreign" FIELDS="authinstance" REFTABLE="auth_instance" REFFIELDS="id" />
                <KEY NAME="localusrfk" TYPE="foreign" FIELDS="localusr" REFTABLE="usr" REFFIELDS="id" />
            </KEYS>
        </TABLE>
Donal McMullan's avatar
Donal McMullan committed
259
260
        <TABLE NAME="sso_session">
            <FIELDS>
261
262
                <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" />
                <FIELD NAME="instanceid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" />
Donal McMullan's avatar
Donal McMullan committed
263
264
265
266
267
268
269
270
                <FIELD NAME="username" TYPE="char" LENGTH="30" NOTNULL="true"/>
                <FIELD NAME="useragent" TYPE="char" LENGTH="40" NOTNULL="true"/>
                <FIELD NAME="token" TYPE="char" LENGTH="40" NOTNULL="true"/>
                <FIELD NAME="confirmtimeout" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" />
                <FIELD NAME="expires" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" />
                <FIELD NAME="sessionid" TYPE="char" LENGTH="40" NOTNULL="true"/>
            </FIELDS>
            <KEYS>
271
                <KEY NAME="primary" TYPE="primary" FIELDS="userid,instanceid" />
Donal McMullan's avatar
Donal McMullan committed
272
273
274
                <!-- <KEY NAME="userfk" TYPE="foreign" FIELDS="userid,username" REFTABLE="usr" REFFIELDS="userid,username" /> -->
            </KEYS>
        </TABLE>
275
276
        <TABLE NAME="host">
            <FIELDS>
277
278
279
280
281
282
283
                <FIELD NAME="wwwroot" TYPE="char" LENGTH="255" NOTNULL="true"/>
                <FIELD NAME="name" TYPE="char" LENGTH="80" NOTNULL="true"/>
                <FIELD NAME="institution" TYPE="char" LENGTH="255" NOTNULL="true"/>
                <FIELD NAME="ipaddress" TYPE="char" LENGTH="39" NOTNULL="true"/>
                <FIELD NAME="appname" TYPE="char" LENGTH="20" NOTNULL="true"/>
                <FIELD NAME="publickey" TYPE="text" NOTNULL="true" DEFAULT=""/>
                <FIELD NAME="publickeyexpires" TYPE="int" LENGTH="10" NOTNULL="true"/>
Donal McMullan's avatar
Donal McMullan committed
284
                <FIELD NAME="deleted" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0"/>
285
                <FIELD NAME="lastconnecttime" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0"/>
286
287
288
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="wwwroot" />
289
290
                <KEY NAME="institutionfk" TYPE="foreign" FIELDS="institution" REFTABLE="institution" REFFIELDS="name"/>
                <KEY NAME="appnamefk" TYPE="foreign" FIELDS="appname" REFTABLE="application" REFFIELDS="name"/>
291
292
            </KEYS>
        </TABLE>
293
294
295
296
297
298
299
300
301
302
303
304
        <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>
305
306
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
                <KEY NAME="callfunctionuk" TYPE="unique" FIELDS="callfunction" />
307
308
            </KEYS>
        </TABLE>
309
310
311
312
313
314
315
316
317
318
319
320
321
        <TABLE NAME="event_log">
            <FIELDS>
                <FIELD NAME="usr" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="realusr" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="time" TYPE="datetime" NOTNULL="true"  />
                <FIELD NAME="event" TYPE="char" LENGTH="255" NOTNULL="false"  />
                <FIELD NAME="data" TYPE="text" NOTNULL="false"  />
            </FIELDS>
            <KEYS>
                <KEY NAME="usrfk" TYPE="foreign" FIELDS="usr" REFTABLE="usr" REFFIELDS="id" />
                <KEY NAME="realusrfk" TYPE="foreign" FIELDS="realusr" REFTABLE="usr" REFFIELDS="id" />
            </KEYS>
        </TABLE>
Penny Leach's avatar
Penny Leach committed
322
323
        <TABLE NAME="activity_type">
            <FIELDS>
324
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
Penny Leach's avatar
Penny Leach committed
325
                <FIELD NAME="name" TYPE="char" LENGTH="50" NOTNULL="true" />
326
                <FIELD NAME="admin" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
327
                <FIELD NAME="delay" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1" />
328
329
                <FIELD NAME="allownonemethod" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1" />
                <FIELD NAME="defaultmethod" TYPE="char" LENGTH="255" NOTNULL="false" DEFAULT="email" />
330
331
                <FIELD NAME="plugintype" TYPE="char" LENGTH="25" NOTNULL="false" />
                <FIELD NAME="pluginname" TYPE="char" LENGTH="255" NOTNULL="false" />
Penny Leach's avatar
Penny Leach committed
332
333
            </FIELDS>
            <KEYS>
334
335
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
                <KEY NAME="namepluginuk" TYPE="unique" FIELDS="name, plugintype, pluginname" />
Penny Leach's avatar
Penny Leach committed
336
337
338
339
340
            </KEYS>
        </TABLE>
        <TABLE NAME="activity_queue">
            <FIELDS>
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
341
                <FIELD NAME="type" TYPE="int" LENGTH="10" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
342
                <FIELD NAME="data" TYPE="text" NOTNULL="true" />
343
                <FIELD NAME="ctime" TYPE="datetime" NOTNULL="false" />
344
                <FIELD NAME="last_processed_userid" TYPE="int" LENGTH="10" NOTNULL="false" />
Penny Leach's avatar
Penny Leach committed
345
346
347
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
348
                <KEY NAME="typefk" TYPE="foreign" FIELDS="type" REFTABLE="activity_type" REFFIELDS="id" />
349
                <KEY NAME="last_processed_useridfk" TYPE="foreign" FIELDS="last_processed_userid" REFTABLE="usr" REFFIELDS="id" />
Penny Leach's avatar
Penny Leach committed
350
351
            </KEYS>
        </TABLE>
352
        <TABLE NAME="grouptype">
Penny Leach's avatar
Penny Leach committed
353
            <FIELDS>
354
                <FIELD NAME="name" TYPE="char" LENGTH="20" NOTNULL="true" />
Richard Mansfield's avatar
Richard Mansfield committed
355
                <FIELD NAME="defaultrole" TYPE="char" LENGTH="255" NOTNULL="true" />
356
357
            </FIELDS>
            <KEYS>
358
                <KEY NAME="primary" TYPE="primary" FIELDS="name" />
359
360
            </KEYS>
        </TABLE>
361
        <TABLE NAME="grouptype_roles">
362
            <FIELDS>
363
                <FIELD NAME="grouptype" TYPE="char" LENGTH="20" NOTNULL="true" />
Richard Mansfield's avatar
Richard Mansfield committed
364
                <FIELD NAME="role" TYPE="char" LENGTH="255" NOTNULL="true" />
365
                <FIELD NAME="see_submitted_views" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
366
367
            </FIELDS>
            <KEYS>
368
369
                <KEY NAME="primary" TYPE="primary" FIELDS="grouptype,role" />
                <KEY NAME="grouptypefk" TYPE="foreign" FIELDS="grouptype" REFTABLE="grouptype" REFFIELDS="name" />
370
371
            </KEYS>
        </TABLE>
Richard Mansfield's avatar
Richard Mansfield committed
372
373
374
375
376
377
378
379
380
381
        <TABLE NAME="group_category">
            <FIELDS>
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
                <FIELD NAME="title" TYPE="char" LENGTH="255" NOTNULL="true" />
                <FIELD NAME="displayorder" TYPE="int" LENGTH="10" NOTNULL="true" />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
            </KEYS>
        </TABLE>
382
        <TABLE NAME="group">
Penny Leach's avatar
Penny Leach committed
383
384
            <FIELDS>
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
385
                <FIELD NAME="name" TYPE="char" LENGTH="128" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
386
                <FIELD NAME="description" TYPE="text" NOTNULL="false" />
387
                <FIELD NAME="grouptype" TYPE="char" LENGTH="20" NOTNULL="true"/>
388
                <FIELD NAME="jointype" TYPE="char" LENGTH="20" NOTNULL="true" ENUM="true" ENUMVALUES="'open', 'controlled', 'approve'"  DEFAULT="open" />
Penny Leach's avatar
Penny Leach committed
389
390
                <FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" />
                <FIELD NAME="mtime" TYPE="datetime" NOTNULL="true" />
391
                <FIELD NAME="public" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
392
                <FIELD NAME="usersautoadded" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
393
                <FIELD NAME="deleted" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
Richard Mansfield's avatar
Richard Mansfield committed
394
                <FIELD NAME="category" TYPE="int" LENGTH="10" NOTNULL="false" />
395
                <FIELD NAME="viewnotify" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1" />
Hugh Davenport's avatar
Hugh Davenport committed
396
397
                <FIELD NAME="quota" TYPE="int" LENGTH="10" NOTNULL="false"/>
                <FIELD NAME="quotaused" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" />
398
399
                <FIELD NAME="institution" TYPE="char" LENGTH="255" NOTNULL="false" />
                <FIELD NAME="shortname" TYPE="char" LENGTH="255" NOTNULL="false" />
400
                <FIELD NAME="request" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
401
                <FIELD NAME="submittableto" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
402
                <FIELD NAME="editroles" TYPE="char" LENGTH="20" NOTNULL="true" ENUM="true" ENUMVALUES="'all', 'notmember', 'admin'" DEFAULT="all" />
403
                <FIELD NAME="hidden" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
404
                <FIELD NAME="hidemembers" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
405
                <FIELD NAME="hidemembersfrommembers" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
406
                <FIELD NAME="groupparticipationreports" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
407
408
                <FIELD NAME="invitefriends" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
                <FIELD NAME="suggestfriends" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
409
                <FIELD NAME="urlid" TYPE="char" LENGTH="30" NOTNULL="false" />
410
411
                <FIELD NAME="editwindowstart" TYPE="datetime" NOTNULL="false" />
                <FIELD NAME="editwindowend" TYPE="datetime" NOTNULL="false" />
412
                <FIELD NAME="sendnow" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
413
                <FIELD NAME="feedbacknotify" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1" />
414
                <FIELD NAME="allowarchives" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
Penny Leach's avatar
Penny Leach committed
415
416
417
418
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
                <KEY NAME="nameuk" TYPE="unique" FIELDS="name" />
419
                <KEY NAME="grouptypefk" TYPE="foreign" FIELDS="grouptype" REFTABLE="grouptype" REFFIELDS="name" />
Richard Mansfield's avatar
Richard Mansfield committed
420
                <KEY NAME="categoryfk" TYPE="foreign" FIELDS="category" REFTABLE="group_category" REFFIELDS="id" />
421
                <KEY NAME="institutionfk" TYPE="foreign" FIELDS="institution" REFTABLE="institution" REFFIELDS="name" />
Penny Leach's avatar
Penny Leach committed
422
            </KEYS>
423
424
            <INDEXES>
                <INDEX NAME="instshortuk" UNIQUE="true" FIELDS="institution, shortname"/>
425
                <INDEX NAME="urliduk" UNIQUE="true" FIELDS="urlid" />
426
            </INDEXES>
Penny Leach's avatar
Penny Leach committed
427
        </TABLE>
428
        <TABLE NAME="group_member">
Penny Leach's avatar
Penny Leach committed
429
            <FIELDS>
430
                <FIELD NAME="group" TYPE="int" LENGTH="10" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
431
                <FIELD NAME="member" TYPE="int" LENGTH="10" NOTNULL="true" />
Richard Mansfield's avatar
Richard Mansfield committed
432
                <FIELD NAME="role" TYPE="char" LENGTH="255" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
433
                <FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" />
434
                <FIELD NAME="method" TYPE="char" LENGTH="100" NOTNULL="true" DEFAULT="internal" />
Penny Leach's avatar
Penny Leach committed
435
436
            </FIELDS>
            <KEYS>
437
438
                <KEY NAME="primary" TYPE="primary" FIELDS="group,member" />
                <KEY NAME="groupfk" TYPE="foreign" FIELDS="group" REFTABLE="group" REFFIELDS="id" />
Penny Leach's avatar
Penny Leach committed
439
440
441
                <KEY NAME="memberfk" TYPE="foreign" FIELDS="member" REFTABLE="usr" REFFIELDS="id" />
            </KEYS>
        </TABLE>
442
        <TABLE NAME="group_member_request">
Penny Leach's avatar
Penny Leach committed
443
            <FIELDS>
444
                <FIELD NAME="group" TYPE="int" LENGTH="10" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
445
446
447
448
449
                <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>
450
451
                <KEY NAME="primary" TYPE="primary" FIELDS="group,member" />
                <KEY NAME="groupfk" TYPE="foreign" FIELDS="group" REFTABLE="group" REFFIELDS="id" />
Penny Leach's avatar
Penny Leach committed
452
453
454
                <KEY NAME="memberfk" TYPE="foreign" FIELDS="member" REFTABLE="usr" REFFIELDS="id" />
            </KEYS>
        </TABLE>
455
        <TABLE NAME="group_member_invite">
Penny Leach's avatar
Penny Leach committed
456
            <FIELDS>
457
                <FIELD NAME="group" TYPE="int" LENGTH="10" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
458
459
460
                <FIELD NAME="member" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" />
                <FIELD NAME="reason" TYPE="text" NOTNULL="false" />
461
                <FIELD NAME="role" TYPE="char" LENGTH="255" NOTNULL="false" />
Penny Leach's avatar
Penny Leach committed
462
463
            </FIELDS>
            <KEYS>
464
465
                <KEY NAME="primary" TYPE="primary" FIELDS="group,member" />
                <KEY NAME="groupfk" TYPE="foreign" FIELDS="group" REFTABLE="group" REFFIELDS="id" />
Penny Leach's avatar
Penny Leach committed
466
467
468
                <KEY NAME="memberfk" TYPE="foreign" FIELDS="member" REFTABLE="usr" REFFIELDS="id" />
            </KEYS>
        </TABLE>
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
        <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="false" />
                <FIELD NAME="institution" TYPE="char" LENGTH="255" NOTNULL="false" />
                <FIELD NAME="group" TYPE="int" LENGTH="10" NOTNULL="false" />
                <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" />
485
486
                <FIELD NAME="author" TYPE="int" LENGTH="10" NOTNULL="false" />
                <FIELD NAME="authorname" TYPE="text" NOTNULL="false" />
487
                <FIELD NAME="allowcomments" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0"  />
488
                <FIELD NAME="approvecomments" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0"  />
489
490
491
                <FIELD NAME="license" TYPE="char" LENGTH="255" NOTNULL="false" />
                <FIELD NAME="licensor" TYPE="char" LENGTH="255" NOTNULL="false" />
                <FIELD NAME="licensorurl" TYPE="char" LENGTH="255" NOTNULL="false" />
492
                <FIELD NAME="path" TYPE="char" LENGTH="1024" NOTNULL="false" />
493
494
495
496
497
498
499
500
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
                <KEY NAME="typefk" TYPE="foreign" FIELDS="artefacttype" REFTABLE="artefact_installed_type" REFFIELDS="name"  />
                <KEY NAME="parentfk" TYPE="foreign" FIELDS="parent" REFTABLE="artefact" REFFIELDS="id" />
                <KEY NAME="usrfk" TYPE="foreign" FIELDS="owner" REFTABLE="usr" REFFIELDS="id" />
                <KEY NAME="institutionfk" TYPE="foreign" FIELDS="institution" REFTABLE="institution" REFFIELDS="name" />
                <KEY NAME="groupfk" TYPE="foreign" FIELDS="group" REFTABLE="group" REFFIELDS="id" />
501
                <KEY NAME="authorfk" TYPE="foreign" FIELDS="author" REFTABLE="usr" REFFIELDS="id" />
502
503
            </KEYS>
        </TABLE>
504
505
506
        <TABLE NAME="artefact_access">
            <FIELDS>
                <FIELD NAME="artefact" TYPE="int" LENGTH="10" NOTNULL="true" />
507
                <FIELD NAME="accesstype" TYPE="char" LENGTH="16" NOTNULL="false" ENUM="true" ENUMVALUES="'public', 'loggedin', 'friends'" />
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
                <FIELD NAME="group" TYPE="int" LENGTH="10" NOTNULL="false" />
                <FIELD NAME="usr" TYPE="int" LENGTH="10" NOTNULL="false" />
                <FIELD NAME="institution" TYPE="char" LENGTH="255" NOTNULL="false" />
                <FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" />
            </FIELDS>
            <KEYS>
                <KEY NAME="artefactfk" TYPE="foreign" FIELDS="artefact" REFTABLE="artefact" REFFIELDS="id" />
                <KEY NAME="groupfk" TYPE="foreign" FIELDS="group" REFTABLE="group" REFFIELDS="id" />
                <KEY NAME="usrfk" TYPE="foreign" FIELDS="usr" REFTABLE="usr" REFFIELDS="id" />
                <KEY NAME="institutionfk" TYPE="foreign" FIELDS="institution" REFTABLE="institution" REFFIELDS="name" />
            </KEYS>
            <INDEXES>
                <INDEX NAME="accesstypeix" UNIQUE="false" FIELDS="accesstype"/>
            </INDEXES>
        </TABLE>
523
524
525
526
        <TABLE NAME="artefact_attachment">
            <FIELDS>
                <FIELD NAME="artefact" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="attachment" TYPE="int" LENGTH="10" NOTNULL="true" />
527
                <FIELD NAME="item" TYPE="int" LENGTH="10" NOTNULL="false" />
528
529
530
531
532
533
534
            </FIELDS>
            <KEYS>
                <KEY NAME="artefact_attachmentpk" TYPE="primary" FIELDS="artefact,attachment" />
                <KEY NAME="artefactfk" TYPE="foreign" FIELDS="artefact" REFTABLE="artefact" REFFIELDS="id" />
                <KEY NAME="attachmentfk" TYPE="foreign" FIELDS="attachment" REFTABLE="artefact" REFFIELDS="id" />
            </KEYS>
        </TABLE>
535
536
537
538
539
540
541
542
543
544
545
        <TABLE NAME="artefact_license">
            <FIELDS>
                <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" />
                <FIELD NAME="displayname" TYPE="char" LENGTH="255" NOTNULL="false" />
                <FIELD NAME="shortname" TYPE="char" LENGTH="255" NOTNULL="false" />
                <FIELD NAME="icon" TYPE="char" LENGTH="255" NOTNULL="true" />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="name" />
            </KEYS>
        </TABLE>
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
        <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>
        <TABLE NAME="artefact_access_usr">
            <FIELDS>
                <FIELD NAME="usr" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="artefact" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="can_republish" TYPE="int" LENGTH="1" NOTNULL="false" />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="usr,artefact" />
                <KEY NAME="usrfk" TYPE="foreign" FIELDS="usr" REFTABLE="usr" REFFIELDS="id" />
                <KEY NAME="artefactfk" TYPE="foreign" FIELDS="artefact" REFTABLE="artefact" REFFIELDS="id" />
            </KEYS>
        </TABLE>
        <TABLE NAME="artefact_access_role">
            <FIELDS>
Richard Mansfield's avatar
Richard Mansfield committed
570
                <FIELD NAME="role" TYPE="char" LENGTH="255" NOTNULL="true" />
571
572
573
574
575
576
577
578
579
580
                <FIELD NAME="artefact" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="can_view" TYPE="int" LENGTH="1" NOTNULL="true" />
                <FIELD NAME="can_edit" TYPE="int" LENGTH="1" NOTNULL="true" />
                <FIELD NAME="can_republish" TYPE="int" LENGTH="1" NOTNULL="true" />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="role,artefact" />
                <KEY NAME="artefactfk" TYPE="foreign" FIELDS="artefact" REFTABLE="artefact" REFFIELDS="id" />
            </KEYS>
        </TABLE>
Richard Mansfield's avatar
Richard Mansfield committed
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
        <TABLE NAME="artefact_log">
            <FIELDS>
                <FIELD NAME="artefact" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="usr" TYPE="int" LENGTH="10" NOTNULL="false" />
                <FIELD NAME="time" TYPE="datetime" NOTNULL="true"  />
                <FIELD NAME="title" TYPE="text" NOTNULL="false"  />
                <FIELD NAME="description" TYPE="text" NOTNULL="false"  />
                <FIELD NAME="parent" TYPE="int" LENGTH="10" NOTNULL="false" />
                <FIELD NAME="created" TYPE="int" LENGTH="1" DEFAULT="0" NOTNULL="false" />
                <FIELD NAME="deleted" TYPE="int" LENGTH="1" DEFAULT="0" NOTNULL="false" />
                <FIELD NAME="edited" TYPE="int" LENGTH="1" DEFAULT="0" NOTNULL="false" />
            </FIELDS>
            <KEYS>
                <KEY NAME="usrfk" TYPE="foreign" FIELDS="usr" REFTABLE="usr" REFFIELDS="id" />
            </KEYS>
            <INDEXES>
                <INDEX NAME="artefactix" UNIQUE="false" FIELDS="artefact"/>
            </INDEXES>
        </TABLE>
600
601
602
603
604
605
606
607
        <TABLE NAME="interaction_instance">
            <FIELDS>
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
                <FIELD NAME="plugin" TYPE="char" LENGTH="255" NOTNULL="true" />
                <FIELD NAME="group" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="title" TYPE="text" NOTNULL="true"  />
                <FIELD NAME="description" TYPE="text" NOTNULL="false"  />
                <FIELD NAME="ctime" TYPE="datetime" NOTNULL="true"  />
Penny Leach's avatar
Penny Leach committed
608
609
                <FIELD NAME="creator" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="deleted" TYPE="int" LENGTH="1" DEFAULT="0" NOTNULL="true" />
610
611
612
613
614
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
                <KEY NAME="pluginfk" TYPE="foreign" FIELDS="plugin" REFTABLE="interaction_installed" REFFIELDS="name" />
                <KEY NAME="groupfk" TYPE="foreign" FIELDS="group" REFTABLE="group" REFFIELDS="id" />
Clare Lenihan's avatar
Clare Lenihan committed
615
                <KEY NAME="creatorfk" TYPE="foreign" FIELDS="creator" REFTABLE="usr" REFFIELDS="id" />
616
617
            </KEYS>
        </TABLE>
Penny Leach's avatar
Penny Leach committed
618
619
620
        <!-- user related tables -->
        <TABLE NAME="usr_account_preference">
            <FIELDS>
Penny Leach's avatar
Penny Leach committed
621
                <FIELD NAME="usr" TYPE="int" LENGTH="10" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
622
623
624
625
                <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
626
                <KEY NAME="primary" TYPE="primary" FIELDS="usr,field" />
627
                <KEY NAME="usrfk" TYPE="foreign" FIELDS="usr" REFTABLE="usr" REFFIELDS="id" />
Penny Leach's avatar
Penny Leach committed
628
629
630
631
            </KEYS>
        </TABLE>
        <TABLE NAME="usr_activity_preference">
            <FIELDS>
Penny Leach's avatar
Penny Leach committed
632
                <FIELD NAME="usr" TYPE="int" LENGTH="10" NOTNULL="true" />
633
                <FIELD NAME="activity" TYPE="int" LENGTH="10" NOTNULL="true" />
634
                <FIELD NAME="method" TYPE="char" LENGTH="255" NOTNULL="false" />
Penny Leach's avatar
Penny Leach committed
635
636
            </FIELDS>
            <KEYS>
Penny Leach's avatar
Penny Leach committed
637
                <KEY NAME="primary" TYPE="primary" FIELDS="usr,activity" />
638
                <KEY NAME="usrfk" TYPE="foreign" FIELDS="usr" REFTABLE="usr" REFFIELDS="id" />
639
                <KEY NAME="activityfk" TYPE="foreign" FIELDS="activity" REFTABLE="activity_type" REFFIELDS="id" />
Penny Leach's avatar
Penny Leach committed
640
641
642
643
644
                <KEY NAME="methodfk" TYPE="foreign" FIELDS="method" REFTABLE="notification_installed" REFFIELDS="name" />
            </KEYS>
        </TABLE>
        <TABLE NAME="usr_friend">
            <FIELDS>
645
646
                <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
647
648
649
                <FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" />
            </FIELDS>
            <KEYS>
650
651
652
               <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
653
654
655
656
657
658
659
            </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" />
660
                <FIELD NAME="message" TYPE="text" NOTNULL="false" />
Penny Leach's avatar
Penny Leach committed
661
662
663
664
665
666
667
668
669
670
            </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" />
671
672
673
674
                <FIELD NAME="institution" TYPE="char" LENGTH="255" NOTNULL="true"/>
                <FIELD NAME="firstname" TYPE="text" NOTNULL="true"/>
                <FIELD NAME="lastname" TYPE="text" NOTNULL="true"/>
                <FIELD NAME="email" TYPE="text" NOTNULL="true"/>
675
                <FIELD NAME="lang" TYPE="text" NOTNULL="false"/>
676
677
                <FIELD NAME="key" TYPE="char" LENGTH="16" NOTNULL="true"/>
                <FIELD NAME="expiry" TYPE="datetime" NOTNULL="true"/>
678
679
                <FIELD NAME="pending" TYPE="int" LENGTH="1" DEFAULT="0" NOTNULL="true"/>
                <FIELD NAME="reason" TYPE="text" NOTNULL="false"/>
680
                <FIELD NAME="extra" TYPE="text" NOTNULL="false"/>
681
                <FIELD NAME="authtype" TYPE="char" LENGTH="255" DEFAULT="internal" NOTNULL="true"/>
Penny Leach's avatar
Penny Leach committed
682
683
684
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
685
                <KEY NAME="institution" TYPE="foreign" FIELDS="institution" REFTABLE="institution" REFFIELDS="name"/>
686
                <KEY NAME="authtype" TYPE="foreign" FIELDS="authtype" REFTABLE="auth_installed" REFFIELDS="name"/>
Penny Leach's avatar
Penny Leach committed
687
            </KEYS>
Richard Mansfield's avatar
Richard Mansfield committed
688
689
690
691
692
693
694
695
696
697
698
        </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
699
700
701
        </TABLE>
        <TABLE NAME="usr_password_request">
            <FIELDS>
Penny Leach's avatar
Penny Leach committed
702
                <FIELD NAME="usr" TYPE="int" LENGTH="10" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
703
                <FIELD NAME="expiry" TYPE="datetime" NOTNULL="true" />
704
                <FIELD NAME="key" TYPE="char" LENGTH="20" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
705
706
            </FIELDS>
            <KEYS>
Penny Leach's avatar
Penny Leach committed
707
708
                <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
709
710
            </KEYS>         
        </TABLE>
711
        <TABLE NAME="view_layout_columns">
712
713
714
715
716
717
718
719
720
721
            <FIELDS>
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
                <FIELD NAME="columns" TYPE="int" LENGTH="1" NOTNULL="true"/>
                <FIELD NAME="widths" TYPE="char" LENGTH="255" NOTNULL="true"/>
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
                <KEY NAME="columnwidthuk" TYPE="unique" FIELDS="columns,widths"/>
            </KEYS>
        </TABLE>
722
723
724
        <TABLE NAME="view_layout">
            <FIELDS>
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
725
726
727
                <FIELD NAME="rows" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="1"/>
                <FIELD NAME="iscustom" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0"/>
                <FIELD NAME="layoutmenuorder" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0"/>
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
            </KEYS>
        </TABLE>
        <TABLE NAME="view_layout_rows_columns">
            <FIELDS>
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
                <FIELD NAME="viewlayout" TYPE="int" LENGTH="10" NOTNULL="true"/>
                <FIELD NAME="row" TYPE="int" LENGTH="1" NOTNULL="true"/>
                <FIELD NAME="columns" TYPE="int" LENGTH="10" NOTNULL="true"/>
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="id"/>            
                <KEY NAME="rowfk" TYPE="foreign" FIELDS="viewlayout" REFTABLE="view_layout" REFFIELDS="id"/>
                <KEY NAME="columnsfk" TYPE="foreign" FIELDS="columns" REFTABLE="view_layout_columns" REFFIELDS="id"/>
            </KEYS>
        </TABLE>
746
747
        <TABLE NAME="view_type">
            <FIELDS>
748
                <FIELD NAME="type" TYPE="char" LENGTH="50" NOTNULL="true" />
749
750
751
752
753
754
755
756
757
758
759
760
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="type" />
            </KEYS>
        </TABLE>
        <!-- this should really be with the rest of the blocktype plugin subsystem but can't because of ordering -->
        <TABLE NAME="blocktype_installed_viewtype">
            <FIELDS>
                <FIELD NAME="blocktype" TYPE="char" LENGTH="50" NOTNULL="true" />
                <FIELD NAME="viewtype" TYPE="char" LENGTH="50" NOTNULL="true" />
            </FIELDS>
            <KEYS>
761
                <KEY NAME="primary" TYPE="primary" FIELDS="blocktype,viewtype" />
762
763
764
765
                <KEY NAME="blocktypefk" TYPE="foreign" FIELDS="blocktype" REFTABLE="blocktype_installed" REFFIELDS="name"  />
                <KEY NAME="viewtypefk" TYPE="foreign" FIELDS="viewtype" REFTABLE="view_type" REFFIELDS="type"  />
            </KEYS>
        </TABLE>
Penny Leach's avatar
Penny Leach committed
766
767
768
769
770
        <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" />
Richard Mansfield's avatar
Richard Mansfield committed
771
                <FIELD NAME="owner" TYPE="int" LENGTH="10" NOTNULL="false" />
772
                <FIELD NAME="ownerformat" TYPE="text" NOTNULL="false" />
Richard Mansfield's avatar
Richard Mansfield committed
773
                <FIELD NAME="group" TYPE="int" LENGTH="10" NOTNULL="false" />
774
                <FIELD NAME="institution" TYPE="char" LENGTH="255" NOTNULL="false" />
775
776
                <FIELD NAME="startdate" TYPE="datetime" NOTNULL="false" />
                <FIELD NAME="stopdate" TYPE="datetime" NOTNULL="false" />
Penny Leach's avatar
Penny Leach committed
777
778
                <FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" />
                <FIELD NAME="mtime" TYPE="datetime" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
779
                <FIELD NAME="atime" TYPE="datetime" NOTNULL="true" />
780
781
                <FIELD NAME="submittedgroup" TYPE="int" LENGTH="10" NOTNULL="false" />
                <FIELD NAME="submittedhost" TYPE="char" LENGTH="255" NOTNULL="false" />
782
                <FIELD NAME="submittedtime" TYPE="datetime" NOTNULL="false" />
783
                <FIELD NAME="submittedstatus" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
784
                <FIELD NAME="numrows" TYPE="int" LENGTH="2" NOTNULL="true" DEFAULT="1" />
Penny Leach's avatar
Penny Leach committed
785
                <FIELD NAME="numcolumns" TYPE="int" LENGTH="2" NOTNULL="true" />
786
                <FIELD NAME="layout" TYPE="int" LENGTH="10" NOTNULL="false"/>
787
                <FIELD NAME="skin" TYPE="int" LENGTH="10" NOTNULL="false"/>
788
                <FIELD NAME="theme" TYPE="char" LENGTH="255" NOTNULL="false"/>
789
                <FIELD NAME="template" TYPE="int" LENGTH="1" DEFAULT="0" NOTNULL="true" />
790
                <FIELD NAME="retainview" TYPE="int" LENGTH="1" DEFAULT="0" NOTNULL="true" />
791
                <FIELD NAME="copynewuser" TYPE="int" LENGTH="1" DEFAULT="0" NOTNULL="true" />
792
                <FIELD NAME="type" TYPE="char" LENGTH="50" NOTNULL="true" />
793
                <FIELD NAME="visits" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" />
794
                <FIELD NAME="allowcomments" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1"  />
795
                <FIELD NAME="approvecomments" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0"  />
796
                <FIELD NAME="accessconf" TYPE="char" LENGTH="40" NOTNULL="false"/>
797
                <FIELD NAME="locked" TYPE="int" LENGTH="1" DEFAULT="0" NOTNULL="true" />
798
                <FIELD NAME="urlid" TYPE="char" LENGTH="100" NOTNULL="false" />
799
                <FIELD NAME="anonymise" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
Penny Leach's avatar
Penny Leach committed
800
801
802
803
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
                <KEY NAME="ownerfk" TYPE="foreign" FIELDS="owner" REFTABLE="usr" REFFIELDS="id" />
804
805
                <KEY NAME="submittedgroupfk" TYPE="foreign" FIELDS="submittedgroup" REFTABLE="group" REFFIELDS="id" />
                <KEY NAME="submittedhostfk" TYPE="foreign" FIELDS="submittedhost" REFTABLE="host" REFFIELDS="wwwroot" />
806
                <KEY NAME="layoutfk" TYPE="foreign" FIELDS="layout" REFTABLE="view_layout" REFFIELDS="id"/>
Richard Mansfield's avatar
Richard Mansfield committed
807
                <KEY NAME="groupfk" TYPE="foreign" FIELDS="group" REFTABLE="group" REFFIELDS="id" />
808
                <KEY NAME="institutionfk" TYPE="foreign" FIELDS="institution" REFTABLE="institution" REFFIELDS="name" />
809
                <KEY NAME="typefk" TYPE="foreign" FIELDS="type" REFTABLE="view_type" REFFIELDS="type" />
Penny Leach's avatar
Penny Leach committed
810
            </KEYS>
811
812
813
            <INDEXES>
                <INDEX NAME="urliduk" UNIQUE="true" FIELDS="urlid,owner,group,institution" />
            </INDEXES>
Penny Leach's avatar
Penny Leach committed
814
        </TABLE>
815
816
817
        <TABLE NAME="usr_custom_layout">
            <FIELDS>
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
818
819
                <FIELD NAME="usr" TYPE="int" LENGTH="10" NOTNULL="false"/>
                <FIELD NAME="group" TYPE="int" LENGTH="10" NOTNULL="false"/>
820
                <FIELD NAME="institution" TYPE="char" LENGTH="255" NOTNULL="false" />
821
822
823
824
825
826
                <FIELD NAME="layout" TYPE="int" LENGTH="10" NOTNULL="true"/>
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
                <KEY NAME="layoutfk" TYPE="foreign" FIELDS="layout" REFTABLE="view_layout" REFFIELDS="id"/>
                <KEY NAME="usrfk" TYPE="foreign" FIELDS="usr" REFTABLE="usr" REFFIELDS="id"/>
827
                <KEY NAME="groupfk" TYPE="foreign" FIELDS="group" REFTABLE="group" REFFIELDS="id" />
828
                <KEY NAME="institutionfk" TYPE="foreign" FIELDS="institution" REFTABLE="institution" REFFIELDS="name" />
829
830
831
832
833
834
835
836
837
838
839
840
841
842
            </KEYS>
        </TABLE>
        <TABLE NAME="view_rows_columns">
            <FIELDS>
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
                <FIELD NAME="view" TYPE="int" LENGTH="10" NOTNULL="true"/>
                <FIELD NAME="row" TYPE="int" LENGTH="1" NOTNULL="true"/>
                <FIELD NAME="columns" TYPE="int" LENGTH="1" NOTNULL="true"/>
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
                <KEY NAME="viewfk" TYPE="foreign" FIELDS="view" REFTABLE="view" REFFIELDS="id"/>
            </KEYS>
        </TABLE>
843
844
845
846
847
848
849
850
851
852
        <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>
853
854
855
856
857
858
859
860
861
862
863
        <TABLE NAME="view_autocreate_grouptype">
            <FIELDS>
                <FIELD NAME="view" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="grouptype" TYPE="char" LENGTH="20" NOTNULL="true" />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="view,grouptype" />
                <KEY NAME="viewfk" TYPE="foreign" FIELDS="view" REFTABLE="view" REFFIELDS="id" />
                <KEY NAME="grouptypefk" TYPE="foreign" FIELDS="grouptype" REFTABLE="grouptype" REFFIELDS="name" />
            </KEYS>
        </TABLE>
Penny Leach's avatar
Penny Leach committed
864
        <TABLE NAME="block_instance">
Penny Leach's avatar
Penny Leach committed
865
866
            <FIELDS>
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
Penny Leach's avatar
Penny Leach committed
867
868
869
                <FIELD NAME="blocktype" TYPE="char" LENGTH="255" NOTNULL="true" />
                <FIELD NAME="title" TYPE="char" LENGTH="255" NOTNULL="true" />
                <FIELD NAME="configdata" TYPE="text" NOTNULL="false" />
Penny Leach's avatar
Penny Leach committed
870
                <FIELD NAME="view" TYPE="int" LENGTH="10" NOTNULL="true" />
871
                <FIELD NAME="row" TYPE="int" LENGTH="2" NOTNULL="true" DEFAULT="1" />
Penny Leach's avatar
Penny Leach committed
872
873
                <FIELD NAME="column" TYPE="int" LENGTH="2" NOTNULL="true" />
                <FIELD NAME="order" TYPE="int" LENGTH="2" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
874
875
876
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
Penny Leach's avatar
Penny Leach committed
877
                <KEY NAME="blocktypefk" TYPE="foreign" FIELDS="blocktype" REFTABLE="blocktype_installed" REFFIELDS="name" />
Penny Leach's avatar
Penny Leach committed
878
                <KEY NAME="viewfk" TYPE="foreign" FIELDS="view" REFTABLE="view" REFFIELDS="id" />
879
                <KEY NAME="viewrowcolumnorderuk" TYPE="unique" FIELDS="view,row,column,order" />
880
881
            </KEYS>
        </TABLE>
Penny Leach's avatar
Penny Leach committed
882
        <TABLE NAME="view_artefact">
883
884
885
            <FIELDS>
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
                <FIELD NAME="view" TYPE="int" LENGTH="10" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
886
                <FIELD NAME="artefact" TYPE="int" LENGTH="10" NOTNULL="true" />
887
888
889
890
891
                <FIELD NAME="block" TYPE="int" LENGTH="10" NOTNULL="true" />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
                <KEY NAME="viewfk" TYPE="foreign" FIELDS="view" REFTABLE="view" REFFIELDS="id" />
Penny Leach's avatar
Penny Leach committed
892
                <KEY NAME="artefactfk" TYPE="foreign" FIELDS="artefact" REFTABLE="artefact" REFFIELDS="id" />
893
                <KEY NAME="blockfk" TYPE="foreign" FIELDS="block" REFTABLE="block_instance" REFFIELDS="id" />
Penny Leach's avatar
Penny Leach committed
894
895
            </KEYS>
        </TABLE>
Martyn Smith's avatar
Martyn Smith committed
896
897
898
        <TABLE NAME="view_access">
            <FIELDS>
                <FIELD NAME="view" TYPE="int" LENGTH="10" NOTNULL="true" />
899
                <FIELD NAME="accesstype" TYPE="char" LENGTH="16" NOTNULL="false" ENUM="true" ENUMVALUES="'public', 'loggedin', 'friends'" />
900
                <FIELD NAME="group" TYPE="int" LENGTH="10" NOTNULL="false" />
Richard Mansfield's avatar
Richard Mansfield committed
901
                <FIELD NAME="role" TYPE="char" LENGTH="255" NOTNULL="false" />
902
                <FIELD NAME="usr" TYPE="int" LENGTH="10" NOTNULL="false" />
903
                <FIELD NAME="institution" TYPE="char" LENGTH="255" NOTNULL="false" />
904
905
                <FIELD NAME="token" TYPE="char" LENGTH="100" NOTNULL="false" />
                <FIELD NAME="visible" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1" />
Martyn Smith's avatar
Martyn Smith committed
906
907
                <FIELD NAME="startdate" TYPE="datetime" NOTNULL="false" />
                <FIELD NAME="stopdate" TYPE="datetime" NOTNULL="false" />
908
909
                <FIELD NAME="allowcomments" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
                <FIELD NAME="approvecomments" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1" />
910
                <FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
911
912
913
            </FIELDS>
            <KEYS>
                <KEY NAME="viewfk" TYPE="foreign" FIELDS="view" REFTABLE="view" REFFIELDS="id" />
914
                <KEY NAME="groupfk" TYPE="foreign" FIELDS="group" REFTABLE="group" REFFIELDS="id" />
915
                <KEY NAME="usrfk" TYPE="foreign" FIELDS="usr" REFTABLE="usr" REFFIELDS="id" />
916
                <KEY NAME="institutionfk" TYPE="foreign" FIELDS="institution" REFTABLE="institution" REFFIELDS="name" />
Penny Leach's avatar
Penny Leach committed
917
            </KEYS>
918
            <INDEXES>
919
                <INDEX NAME="tokenix" UNIQUE="false" FIELDS="token"/>
920
                <INDEX NAME="accesstypeix" UNIQUE="false" FIELDS="accesstype"/>
921
            </INDEXES>
Richard Mansfield's avatar
Richard Mansfield committed
922
        </TABLE>
923
924
925
926
927
928
929
930
931
932
933
934
        <TABLE NAME="view_visit">
            <FIELDS>
                <FIELD NAME="view" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" />
            </FIELDS>
            <KEYS>
                <KEY NAME="viewfk" TYPE="foreign" FIELDS="view" REFTABLE="view" REFFIELDS="id" />
            </KEYS>
            <INDEXES>
                <INDEX NAME="ctimeix" UNIQUE="false" FIELDS="ctime"/>
            </INDEXES>
        </TABLE>
Richard Mansfield's avatar
Richard Mansfield committed
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
        <TABLE NAME="favorite">
            <FIELDS>
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
                <FIELD NAME="owner" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="shortname" TYPE="char" LENGTH="255" NOTNULL="true" />
                <FIELD NAME="institution" TYPE="char" LENGTH="255" 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" />
                <KEY NAME="institutionfk" TYPE="foreign" FIELDS="institution" REFTABLE="institution" REFFIELDS="name" />
            </KEYS>
            <INDEXES>
                <INDEX NAME="ownershortuk" UNIQUE="true" FIELDS="owner,shortname"/>
            </INDEXES>
        </TABLE>
        <TABLE NAME="favorite_usr">
            <FIELDS>
                <FIELD NAME="favorite" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="usr" TYPE="int" LENGTH="10" NOTNULL="true" />
            </FIELDS>
            <KEYS>
               <KEY NAME="primary" TYPE="primary" FIELDS="favorite,usr" />
               <KEY NAME="favoritefk" TYPE="foreign" FIELDS="favorite" REFTABLE="favorite" REFFIELDS="id" />
               <KEY NAME="usrfk" TYPE="foreign" FIELDS="usr" REFTABLE="usr" REFFIELDS="id" />
            </KEYS>
        </TABLE>
Penny Leach's avatar
Penny Leach committed
964
965
966
967
968
969
970
971
972
973
974
975
        <!-- 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" />
976
                <FIELD NAME="public" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
Penny Leach's avatar
Penny Leach committed
977
978
979
980
981
982
983
984
985
986
987
988
989
990
                <!--- 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" />
991
                <FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
992
                <FIELD NAME="mtime" TYPE="datetime" NOTNULL="true" />
993
                <FIELD NAME="mauthor" TYPE="int" LENGTH="10" NOTNULL="false" />
994
                <FIELD NAME="institution" TYPE="char" LENGTH="255" NOTNULL="true"/>
Penny Leach's avatar
Penny Leach committed
995
996
            </FIELDS>
            <KEYS>
997
                <KEY NAME="primary" TYPE="primary" FIELDS="name,institution" /><