install.xml 37.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
        <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
        <TABLE NAME="institution">
            <FIELDS>
27 28 29
                <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true"/>
                <FIELD NAME="displayname" TYPE="char" LENGTH="255" NOTNULL="true"/>
                <FIELD NAME="registerallowed" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1"/>
30
                <FIELD NAME="theme" TYPE="char" LENGTH="255" NOTNULL="false"/>
31
                <FIELD NAME="defaultmembershipperiod" TYPE="int" NOTNULL="false" />
32
                <FIELD NAME="maxuseraccounts" TYPE="int" NOTNULL="false" />
33 34 35
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="name" />
36 37
            </KEYS>
        </TABLE>
38 39 40 41 42 43 44
        <!-- 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" />
45 46
            </FIELDS>
            <KEYS>
47
                <KEY NAME="primary" TYPE="primary" FIELDS="name" />
48
            </KEYS>
49 50 51 52 53 54 55 56 57 58
        </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>
59
        </TABLE>
60
        <TABLE NAME="usr">
61
            <FIELDS>
62 63 64 65 66
                <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"/>
                <FIELD NAME="salt" TYPE="char" LENGTH="8"/>
                <FIELD NAME="passwordchange" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0"/>
67
                <FIELD NAME="active" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1"/>
68 69
                <FIELD NAME="deleted" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0"/>
                <FIELD NAME="expiry" TYPE="datetime" NOTNULL="false"/>
70
                <FIELD NAME="expirymailsent" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0"/>
71
                <FIELD NAME="lastlogin" TYPE="datetime" NOTNULL="false"/>
72
                <FIELD NAME="inactivemailsent" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0"/>
73 74 75 76 77 78
                <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"/>
79
                <FIELD NAME="email" TYPE="char" LENGTH="255" NOTNULL="false"/>
80 81 82 83
                <!-- 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
84 85 86
                <FIELD NAME="suspendedctime" TYPE="datetime" NOTNULL="false"/>
                <FIELD NAME="suspendedreason" TYPE="text" NOTNULL="false"/>
                <FIELD NAME="suspendedcusr" TYPE="int" LENGTH="10" NOTNULL="false"/>
87 88
                <FIELD NAME="quota" TYPE="int" LENGTH="10" NOTNULL="false"/>
                <FIELD NAME="quotaused" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" />
89 90
                <FIELD NAME="authinstance" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="1" />
                <FIELD NAME="sessionid" TYPE="char" LENGTH="32" NOTNULL="false" DEFAULT="" />
91
                <FIELD NAME="lastauthinstance" TYPE="int" LENGTH="10" NOTNULL="false" DEFAULT="NULL" />
92 93
            </FIELDS>
            <KEYS>
94
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
95
                <KEY NAME="lastauthinstancefk" TYPE="foreign" FIELDS="lastauthinstance" REFTABLE="auth_instance" REFFIELDS="id" />
96
                <KEY NAME="authinstancefk" TYPE="foreign" FIELDS="authinstance" REFTABLE="auth_instance" REFFIELDS="id" />
97 98
            </KEYS>
            <INDEXES>
99
                <INDEX NAME="usernameuk" UNIQUE="true" FIELDS="username"/>
100 101
            </INDEXES>
        </TABLE>
102 103 104 105 106 107
        <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"/>
108
                <FIELD NAME="expirymailsent" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0"/>
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133
                <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>
134 135 136 137 138 139 140 141 142 143 144 145
        <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
146 147
        <TABLE NAME="sso_session">
            <FIELDS>
148 149
                <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
150 151 152 153 154 155 156 157
                <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>
158
                <KEY NAME="primary" TYPE="primary" FIELDS="userid,instanceid" />
Donal McMullan's avatar
Donal McMullan committed
159 160 161
                <!-- <KEY NAME="userfk" TYPE="foreign" FIELDS="userid,username" REFTABLE="usr" REFFIELDS="userid,username" /> -->
            </KEYS>
        </TABLE>
162 163
        <TABLE NAME="host">
            <FIELDS>
164 165 166 167 168 169 170 171
                <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="portno" TYPE="int" LENGTH="2" NOTNULL="true" DEFAULT="80"/>
                <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
172
                <FIELD NAME="deleted" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0"/>
173
                <FIELD NAME="lastconnecttime" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0"/>
174 175 176
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="wwwroot" />
177 178
                <KEY NAME="institutionfk" TYPE="foreign" FIELDS="institution" REFTABLE="institution" REFFIELDS="name"/>
                <KEY NAME="appnamefk" TYPE="foreign" FIELDS="appname" REFTABLE="application" REFFIELDS="name"/>
179 180
            </KEYS>
        </TABLE>
181 182 183 184 185 186 187 188 189 190 191 192
        <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>
193 194
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
                <KEY NAME="callfunctionuk" TYPE="unique" FIELDS="callfunction" />
195 196
            </KEYS>
        </TABLE>
Penny Leach's avatar
Penny Leach committed
197 198
        <TABLE NAME="activity_type">
            <FIELDS>
199
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
Penny Leach's avatar
Penny Leach committed
200
                <FIELD NAME="name" TYPE="char" LENGTH="50" NOTNULL="true" />
201
                <FIELD NAME="admin" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
202
                <FIELD NAME="delay" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1" />
203 204
                <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
205 206
            </FIELDS>
            <KEYS>
207 208
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
                <KEY NAME="namepluginuk" TYPE="unique" FIELDS="name, plugintype, pluginname" />
Penny Leach's avatar
Penny Leach committed
209 210 211 212 213
            </KEYS>
        </TABLE>
        <TABLE NAME="activity_queue">
            <FIELDS>
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
214
                <FIELD NAME="type" TYPE="int" LENGTH="10" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
215 216 217 218 219
                <FIELD NAME="data" TYPE="text" NOTNULL="true" />
                <FIELD NAME="ctime" TYPE="datetime" />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
220
                <KEY NAME="typefk" TYPE="foreign" FIELDS="type" REFTABLE="activity_type" REFFIELDS="id" />
Penny Leach's avatar
Penny Leach committed
221 222 223 224 225 226 227 228
            </KEYS>
        </TABLE>
        <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"  />
229 230
                <FIELD NAME="owner" TYPE="int" LENGTH="10" NOTNULL="false" />
                <FIELD NAME="institution" TYPE="char" LENGTH="255" NOTNULL="false" />
231
                <FIELD NAME="group" TYPE="int" LENGTH="10" NOTNULL="false" />
Penny Leach's avatar
Penny Leach committed
232 233 234 235 236 237 238 239 240 241
                <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
242
                <KEY NAME="typefk" TYPE="foreign" FIELDS="artefacttype" REFTABLE="artefact_installed_type" REFFIELDS="name"  />
Penny Leach's avatar
Penny Leach committed
243
                <KEY NAME="parentfk" TYPE="foreign" FIELDS="parent" REFTABLE="artefact" REFFIELDS="id" />
244
                <KEY NAME="usrfk" TYPE="foreign" FIELDS="owner" REFTABLE="usr" REFFIELDS="id" />
245
                <KEY NAME="institutionfk" TYPE="foreign" FIELDS="institution" REFTABLE="institution" REFFIELDS="name" />
246
                <KEY NAME="groupfk" TYPE="foreign" FIELDS="group" REFTABLE="group" REFFIELDS="id" />
Penny Leach's avatar
Penny Leach committed
247 248
            </KEYS>
        </TABLE>
249 250 251 252 253 254 255 256 257 258
        <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>
259 260 261 262
        <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
263
                <FIELD NAME="dirty" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
264 265 266 267 268 269 270
            </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>
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
        <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>
                <FIELD NAME="role" TYPE="text" NOTNULL="true" />
                <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>
296 297 298 299 300 301 302 303 304 305 306 307 308
        <TABLE NAME="grouptype">
            <FIELDS>
                <FIELD NAME="name" TYPE="char" LENGTH="20" NOTNULL="true" />
                <FIELD NAME="takesviewsubmissions" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="name" />
            </KEYS>
        </TABLE>
        <TABLE NAME="grouptype_roles">
            <FIELDS>
                <FIELD NAME="grouptype" TYPE="char" LENGTH="20" NOTNULL="true" />
                <FIELD NAME="role" TYPE="text" NOTNULL="true" />
309
                <FIELD NAME="edit_views" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1" />
310 311 312 313 314 315
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="grouptype,role" />
                <KEY NAME="grouptypefk" TYPE="foreign" FIELDS="grouptype" REFTABLE="grouptype" REFFIELDS="name" />
            </KEYS>
        </TABLE>
316
        <TABLE NAME="group">
Penny Leach's avatar
Penny Leach committed
317 318
            <FIELDS>
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
319
                <FIELD NAME="name" TYPE="char" LENGTH="128" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
320
                <FIELD NAME="description" TYPE="text" NOTNULL="false" />
321
                <FIELD NAME="grouptype" TYPE="char" LENGTH="20" NOTNULL="true"/>
Penny Leach's avatar
Penny Leach committed
322
                <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
323 324
                <FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" />
                <FIELD NAME="mtime" TYPE="datetime" NOTNULL="true" />
325
                <FIELD NAME="deleted" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
Penny Leach's avatar
Penny Leach committed
326 327 328 329
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
                <KEY NAME="nameuk" TYPE="unique" FIELDS="name" />
330
                <KEY NAME="grouptypefk" TYPE="foreign" FIELDS="grouptype" REFTABLE="grouptype" REFFIELDS="name" />
Penny Leach's avatar
Penny Leach committed
331 332
            </KEYS>
        </TABLE>
333
        <TABLE NAME="group_member">
Penny Leach's avatar
Penny Leach committed
334
            <FIELDS>
335
                <FIELD NAME="group" TYPE="int" LENGTH="10" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
336
                <FIELD NAME="member" TYPE="int" LENGTH="10" NOTNULL="true" />
337
                <FIELD NAME="role" TYPE="text" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
338 339 340
                <FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" />
            </FIELDS>
            <KEYS>
341 342
                <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
343 344 345
                <KEY NAME="memberfk" TYPE="foreign" FIELDS="member" REFTABLE="usr" REFFIELDS="id" />
            </KEYS>
        </TABLE>
346
        <TABLE NAME="group_member_request">
Penny Leach's avatar
Penny Leach committed
347
            <FIELDS>
348
                <FIELD NAME="group" TYPE="int" LENGTH="10" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
349 350 351 352 353
                <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>
354 355
                <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
356 357 358
                <KEY NAME="memberfk" TYPE="foreign" FIELDS="member" REFTABLE="usr" REFFIELDS="id" />
            </KEYS>
        </TABLE>
359
        <TABLE NAME="group_member_invite">
Penny Leach's avatar
Penny Leach committed
360
            <FIELDS>
361
                <FIELD NAME="group" TYPE="int" LENGTH="10" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
362 363 364 365 366
                <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>
367 368
                <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
369 370 371
                <KEY NAME="memberfk" TYPE="foreign" FIELDS="member" REFTABLE="usr" REFFIELDS="id" />
            </KEYS>
        </TABLE>
372 373 374 375 376 377 378 379
        <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
380 381
                <FIELD NAME="creator" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="deleted" TYPE="int" LENGTH="1" DEFAULT="0" NOTNULL="true" />
382 383 384 385 386
            </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
387
                <KEY NAME="creatorfk" TYPE="foreign" FIELDS="creator" REFTABLE="usr" REFFIELDS="id" />
388 389
            </KEYS>
        </TABLE>
Penny Leach's avatar
Penny Leach committed
390 391 392
        <!-- user related tables -->
        <TABLE NAME="usr_account_preference">
            <FIELDS>
Penny Leach's avatar
Penny Leach committed
393
                <FIELD NAME="usr" TYPE="int" LENGTH="10" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
394 395 396 397
                <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
398
                <KEY NAME="primary" TYPE="primary" FIELDS="usr,field" />
399
                <KEY NAME="usrfk" TYPE="foreign" FIELDS="usr" REFTABLE="usr" REFFIELDS="id" />
Penny Leach's avatar
Penny Leach committed
400 401 402 403
            </KEYS>
        </TABLE>
        <TABLE NAME="usr_activity_preference">
            <FIELDS>
Penny Leach's avatar
Penny Leach committed
404
                <FIELD NAME="usr" TYPE="int" LENGTH="10" NOTNULL="true" />
405
                <FIELD NAME="activity" TYPE="int" LENGTH="10" NOTNULL="true" />
406
                <FIELD NAME="method" TYPE="char" LENGTH="255" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
407 408
            </FIELDS>
            <KEYS>
Penny Leach's avatar
Penny Leach committed
409
                <KEY NAME="primary" TYPE="primary" FIELDS="usr,activity" />
410
                <KEY NAME="usrfk" TYPE="foreign" FIELDS="usr" REFTABLE="usr" REFFIELDS="id" />
411
                <KEY NAME="activityfk" TYPE="foreign" FIELDS="activity" REFTABLE="activity_type" REFFIELDS="id" />
Penny Leach's avatar
Penny Leach committed
412 413 414 415 416
                <KEY NAME="methodfk" TYPE="foreign" FIELDS="method" REFTABLE="notification_installed" REFFIELDS="name" />
            </KEYS>
        </TABLE>
        <TABLE NAME="usr_friend">
            <FIELDS>
417 418
                <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
419 420 421
                <FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" />
            </FIELDS>
            <KEYS>
422 423 424
               <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
425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442
            </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" />
443 444 445 446 447 448 449
                <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"/>
450
                <FIELD NAME="lang" TYPE="text" NOTNULL="false"/>
451 452
                <FIELD NAME="key" TYPE="char" LENGTH="16" NOTNULL="true"/>
                <FIELD NAME="expiry" TYPE="datetime" NOTNULL="true"/>
Penny Leach's avatar
Penny Leach committed
453 454 455
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
456
                <KEY NAME="institution" TYPE="foreign" FIELDS="institution" REFTABLE="institution" REFFIELDS="name"/>
Penny Leach's avatar
Penny Leach committed
457
            </KEYS>
Richard Mansfield's avatar
Richard Mansfield committed
458 459 460 461 462 463 464 465 466 467 468
        </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
469 470 471
        </TABLE>
        <TABLE NAME="usr_password_request">
            <FIELDS>
Penny Leach's avatar
Penny Leach committed
472
                <FIELD NAME="usr" TYPE="int" LENGTH="10" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
473
                <FIELD NAME="expiry" TYPE="datetime" NOTNULL="true" />
474
                <FIELD NAME="key" TYPE="char" LENGTH="20" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
475 476
            </FIELDS>
            <KEYS>
Penny Leach's avatar
Penny Leach committed
477 478
                <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
479 480
            </KEYS>         
        </TABLE>
481 482 483 484 485 486 487 488 489 490 491
        <TABLE NAME="view_layout">
            <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>
Penny Leach's avatar
Penny Leach committed
492 493 494 495 496
        <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
497
                <FIELD NAME="owner" TYPE="int" LENGTH="10" NOTNULL="false" />
Penny Leach's avatar
Penny Leach committed
498
                <FIELD NAME="ownerformat" TYPE="text" NOTNULL="true" />
Richard Mansfield's avatar
Richard Mansfield committed
499
                <FIELD NAME="group" TYPE="int" LENGTH="10" NOTNULL="false" />
500
                <FIELD NAME="startdate" TYPE="datetime" />
Martyn Smith's avatar
Martyn Smith committed
501
                <FIELD NAME="stopdate" TYPE="datetime" />
Penny Leach's avatar
Penny Leach committed
502 503
                <FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" />
                <FIELD NAME="mtime" TYPE="datetime" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
504
                <FIELD NAME="atime" TYPE="datetime" NOTNULL="true" />
505
                <FIELD NAME="submittedto" TYPE="int" LENGTH="10" NOTNULL="false" />
Penny Leach's avatar
Penny Leach committed
506
                <FIELD NAME="numcolumns" TYPE="int" LENGTH="2" NOTNULL="true" />
507
                <FIELD NAME="layout" TYPE="int" LENGTH="10"/>
Penny Leach's avatar
Penny Leach committed
508 509 510 511
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
                <KEY NAME="ownerfk" TYPE="foreign" FIELDS="owner" REFTABLE="usr" REFFIELDS="id" />
512
                <KEY NAME="submittedtofk" TYPE="foreign" FIELDS="submittedto" REFTABLE="group" REFFIELDS="id" />
513
                <KEY NAME="layoutfk" TYPE="foreign" FIELDS="layout" REFTABLE="view_layout" REFFIELDS="id"/>
Richard Mansfield's avatar
Richard Mansfield committed
514
                <KEY NAME="groupfk" TYPE="foreign" FIELDS="group" REFTABLE="group" REFFIELDS="id" />
Penny Leach's avatar
Penny Leach committed
515 516
            </KEYS>
        </TABLE>
517 518 519 520 521 522 523 524 525 526
        <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
527
        <TABLE NAME="block_instance">
Penny Leach's avatar
Penny Leach committed
528 529
            <FIELDS>
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
Penny Leach's avatar
Penny Leach committed
530 531 532
                <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
533
                <FIELD NAME="view" TYPE="int" LENGTH="10" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
534 535
                <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
536 537 538
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
Penny Leach's avatar
Penny Leach committed
539
                <KEY NAME="blocktypefk" TYPE="foreign" FIELDS="blocktype" REFTABLE="blocktype_installed" REFFIELDS="name" />
Penny Leach's avatar
Penny Leach committed
540
                <KEY NAME="viewfk" TYPE="foreign" FIELDS="view" REFTABLE="view" REFFIELDS="id" />
Penny Leach's avatar
Penny Leach committed
541
                <KEY NAME="viewcolumnorderuk" TYPE="unique" FIELDS="view,column,order" />
542 543
            </KEYS>
        </TABLE>
Penny Leach's avatar
Penny Leach committed
544
        <TABLE NAME="view_artefact">
545 546 547
            <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
548
                <FIELD NAME="artefact" TYPE="int" LENGTH="10" NOTNULL="true" />
549 550 551 552 553
                <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
554
                <KEY NAME="artefactfk" TYPE="foreign" FIELDS="artefact" REFTABLE="artefact" REFFIELDS="id" />
555
                <KEY NAME="blockfk" TYPE="foreign" FIELDS="block" REFTABLE="block_instance" REFFIELDS="id" />
Penny Leach's avatar
Penny Leach committed
556 557
            </KEYS>
        </TABLE>
Richard Mansfield's avatar
Richard Mansfield committed
558 559
        <TABLE NAME="view_feedback">
            <FIELDS>
560
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
Richard Mansfield's avatar
Richard Mansfield committed
561 562
                <FIELD NAME="view" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="author" TYPE="int" LENGTH="10" NOTNULL="true" />
563
                <FIELD NAME="message" TYPE="text" NOTNULL="true" />
Richard Mansfield's avatar
Richard Mansfield committed
564 565 566 567 568 569 570 571 572 573 574
                <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>
575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591
        <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
592 593 594
        <TABLE NAME="view_access">
            <FIELDS>
                <FIELD NAME="view" TYPE="int" LENGTH="10" NOTNULL="true" />
595
                <FIELD NAME="accesstype" TYPE="char" LENGTH="16" NOTNULL="true" ENUM="true" ENUMVALUES="'public', 'loggedin', 'friends'" DEFAULT="public" />
Martyn Smith's avatar
Martyn Smith committed
596 597 598 599 600 601 602
                <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>
603
        <TABLE NAME="view_access_group">
Penny Leach's avatar
Penny Leach committed
604 605
            <FIELDS>
                <FIELD NAME="view" TYPE="int" LENGTH="10" NOTNULL="true" />
606
                <FIELD NAME="group" TYPE="int" LENGTH="10" NOTNULL="true" />
Richard Mansfield's avatar
Richard Mansfield committed
607
                <FIELD NAME="role" TYPE="text" NOTNULL="false" />
Martyn Smith's avatar
Martyn Smith committed
608 609
                <FIELD NAME="startdate" TYPE="datetime" NOTNULL="false" />
                <FIELD NAME="stopdate" TYPE="datetime" NOTNULL="false" />
Penny Leach's avatar
Penny Leach committed
610 611 612
            </FIELDS>
            <KEYS>
                <KEY NAME="viewfk" TYPE="foreign" FIELDS="view" REFTABLE="view" REFFIELDS="id" />
613
                <KEY NAME="groupfk" TYPE="foreign" FIELDS="group" REFTABLE="group" REFFIELDS="id" />
Penny Leach's avatar
Penny Leach committed
614 615
            </KEYS>
        </TABLE>
616
        <TABLE NAME="view_access_usr">
Penny Leach's avatar
Penny Leach committed
617 618
            <FIELDS>
                <FIELD NAME="view" TYPE="int" LENGTH="10" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
619
                <FIELD NAME="usr" TYPE="int" LENGTH="10" NOTNULL="true" />
Martyn Smith's avatar
Martyn Smith committed
620 621
                <FIELD NAME="startdate" TYPE="datetime" NOTNULL="false" />
                <FIELD NAME="stopdate" TYPE="datetime" NOTNULL="false" />
Penny Leach's avatar
Penny Leach committed
622 623 624
            </FIELDS>
            <KEYS>
                <KEY NAME="viewfk" TYPE="foreign" FIELDS="view" REFTABLE="view" REFFIELDS="id" />
625
                <KEY NAME="usrfk" TYPE="foreign" FIELDS="usr" REFTABLE="usr" REFFIELDS="id" />
Penny Leach's avatar
Penny Leach committed
626 627 628 629 630 631 632 633 634 635 636 637 638 639
            </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" />
640
                <FIELD NAME="public" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
Penny Leach's avatar
Penny Leach committed
641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656
                <!--- 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" />
657
                <FIELD NAME="mauthor" TYPE="int" LENGTH="10" NOTNULL="false" />
Penny Leach's avatar
Penny Leach committed
658 659 660 661 662 663 664 665 666
            </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_view">
            <FIELDS>
Penny Leach's avatar
Penny Leach committed
667
                <FIELD NAME="usr" TYPE="int" LENGTH="10" NOTNULL="true" />
Penny Leach's avatar
Penny Leach committed
668 669 670 671
                <FIELD NAME="view" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" />
            </FIELDS>
            <KEYS>
Penny Leach's avatar
Penny Leach committed
672
                <KEY NAME="primary" TYPE="primary" FIELDS="usr,view" />
673
                <KEY NAME="usrfk" TYPE="foreign" FIELDS="usr" REFTABLE="usr" REFFIELDS="id" />
Penny Leach's avatar
Penny Leach committed
674 675 676
                <KEY NAME="viewfk" TYPE="foreign" FIELDS="view" REFTABLE="view" REFFIELDS="id" />
            </KEYS>
        </TABLE>
677
    </TABLES>
678
</XMLDB>