install.xml 11.2 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>
7 8 9 10 11
        <!-- core tables -->
        <TABLE NAME="config">
            <FIELDS>
                <FIELD NAME="field" TYPE="char" LENGTH="255" NOTNULL="true" />
                <FIELD NAME="value" TYPE="text" LENGTH="small" NOTNULL="true" />
12 13
            </FIELDS>
            <KEYS>
14
                <KEY NAME="primary" TYPE="primary" FIELDS="field" />
15 16
            </KEYS>
        </TABLE>
17
        <TABLE NAME="usr">
18
            <FIELDS>
19
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
20 21 22 23
                <FIELD NAME="username" TYPE="char" LENGTH="100" NOTNULL="true" />
                <FIELD NAME="password" TYPE="char" LENGTH="40" NOTNULL="true" />
                <FIELD NAME="salt" TYPE="char" LENGTH="8" />
                <FIELD NAME="password_change" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" />
24 25
            </FIELDS>
            <KEYS>
26
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
27 28 29 30 31
            </KEYS>
            <INDEXES>
                <INDEX NAME="usernameuk" UNIQUE="true" FIELDS="LOWER(username)"/>
            </INDEXES>
        </TABLE>
Penny Leach's avatar
Penny Leach committed
32
        <TABLE NAME="event_type">
33 34 35 36 37
            <FIELDS>
                <FIELD NAME="name" TYPE="char" LENGTH="50" NOTNULL="true" />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="name" />
38 39
            </KEYS>
        </TABLE>
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
        <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>
                <KEY NAME="primary" TYPE="primary" FIELDS="callfunction" />
            </KEYS>
        </TABLE>
        <!-- auth plugin tables -->
56
        <TABLE NAME="auth_installed">
57
            <FIELDS> 
58 59 60 61
                <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" />
                <FIELD NAME="version" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="release" TYPE="text" LENGTH="small" NOTNULL="true" />
                <FIELD NAME="active" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1" />
62 63
            </FIELDS>
            <KEYS>
64
                <KEY NAME="primary" TYPE="primary" FIELDS="name" />
65 66
            </KEYS>
        </TABLE>
67
        <TABLE NAME="auth_config">
68
            <FIELDS>
69 70
                <FIELD NAME="plugin" TYPE="char" LENGTH="100" NOTNULL="true" />
                <FIELD NAME="field" TYPE="char" LENGTH="100" NOTNULL="true" />
71
                <FIELD NAME="value" TYPE="text" LENGTH="small" NOTNULL="true" />
72 73
            </FIELDS>
            <KEYS>
74 75
                <KEY NAME="primary" TYPE="primary" FIELDS="plugin,field" />
                <KEY NAME="pluginfk" TYPE="foreign" FIELDS="plugin" REFTABLE="auth_installed" REFFIELDS="name" />
76 77
            </KEYS>
        </TABLE>
78
        <TABLE NAME="auth_cron">
79
            <FIELDS>
80 81 82 83 84 85 86 87
                <FIELD NAME="plugin" TYPE="char" LENGTH="255" NOTNULL="true" />
                <FIELD NAME="callfunction" TYPE="char" LENGTH="255" NOTNULL="true"  />
                <FIELD NAME="nextrun" TYPE="datetime" NOTNULL="false"  />
                <FIELD NAME="minute" TYPE="char" LENGTH="25" NOTNULL="true" DEFAULT="*"  />
                <FIELD NAME="hour" TYPE="char" LENGTH="25" NOTNULL="true" DEFAULT="*"  />
                <FIELD NAME="day" TYPE="char" LENGTH="25" NOTNULL="true" DEFAULT="*"  />
                <FIELD NAME="month" TYPE="char" LENGTH="25" NOTNULL="true" DEFAULT="*"  />
                <FIELD NAME="dayofweek" TYPE="char" LENGTH="25" NOTNULL="true" DEFAULT="*" />
88 89
            </FIELDS>
            <KEYS>
90 91
                <KEY NAME="primary" TYPE="primary" FIELDS="plugin,callfunction" />
                <KEY NAME="pluginfk" TYPE="foreign" FIELDS="plugin" REFTABLE="auth_installed" REFFIELDS="name" />
92 93
            </KEYS>
        </TABLE>
94
        <TABLE NAME="auth_event_subscription">
95
            <FIELDS>
96 97 98 99
                <FIELD NAME="id" TYPE="int" LENGTH="10" SEQUENCE="true"  NOTNULL="true" />
                <FIELD NAME="plugin" TYPE="char" LENGTH="255" NOTNULL="true" />
                <FIELD NAME="event" TYPE="char" LENGTH="50" NOTNULL="true" />
                <FIELD NAME="callfunction" TYPE="char" LENGTH="255" NOTNULL="true" />
100 101
            </FIELDS>
            <KEYS>
102
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
103
                <KEY NAME="pluginfk" TYPE="foreign" FIELDS="plugin" REFTABLE="auth_installed" REFFIELDS="name" />
Penny Leach's avatar
Penny Leach committed
104
                <KEY NAME="eventfk" TYPE="foreign" FIELDS="event" REFTABLE="event_type" REFFIELDS="name" />
105
                <KEY NAME="subscruk" TYPE="unique" FIELDS="plugin,event,callfunction" />
106 107
            </KEYS>
        </TABLE>
108 109 110 111 112 113 114 115 116 117 118 119 120
        <!-- artefact plugin tables -->
        <TABLE NAME="artefact_installed">
            <FIELDS> 
                <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" />
                <FIELD NAME="version" TYPE="int" LENGTH="10" NOTNULL="true" />
                <FIELD NAME="release" TYPE="text" LENGTH="small" NOTNULL="true" />
                <FIELD NAME="active" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1" />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="name" />
            </KEYS>
        </TABLE>
        <TABLE NAME="artefact_installed_type">
121
            <FIELDS>
122
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
123 124
                <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" />
                <FIELD NAME="plugin" TYPE="char" LENGTH="255" NOTNULL="true" />
125 126
            </FIELDS>
            <KEYS>
127
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
128 129 130 131 132 133 134 135 136 137 138 139 140
                <KEY NAME="nameuk" TYPE="unique" FIELDS="name,plugin"  />
                <KEY NAME="pluginfk" TYPE="foreign" FIELDS="plugin" REFTABLE="artefact_installed" REFFIELDS="name" />
            </KEYS>
        </TABLE>
        <TABLE NAME="artefact_config">
            <FIELDS>
                <FIELD NAME="plugin" TYPE="char" LENGTH="100" NOTNULL="true" />
                <FIELD NAME="field" TYPE="char" LENGTH="100" NOTNULL="true" />
                <FIELD NAME="value" TYPE="text" LENGTH="small" NOTNULL="true" />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="plugin,field" />
                <KEY NAME="pluginfk" TYPE="foreign" FIELDS="plugin" REFTABLE="artefact_installed" REFFIELDS="name" />
141 142
            </KEYS>
        </TABLE>
143
        <TABLE NAME="artefact">
144
            <FIELDS>
145 146 147 148 149 150 151 152 153 154 155
                <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="parentid" TYPE="int" LENGTH="10" NOTNULL="false"  />
                <FIELD NAME="ctime" TYPE="datetime" NOTNULL="true"  />
                <FIELD NAME="mtime" TYPE="datetime" NOTNULL="true"  />
                <FIELD NAME="vtime" 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" />
156 157
            </FIELDS>
            <KEYS>
158
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
159
                <KEY NAME="typefk" TYPE="foreign" FIELDS="artefacttype" REFTABLE="artefact_installed_type" REFFIELDS="id"  />
160
                <KEY NAME="parentfk" TYPE="foreign" FIELDS="parentid" REFTABLE="artefact" REFFIELDS="id" />
161 162
            </KEYS>
        </TABLE>
163
        <TABLE NAME="artefact_cron">
164
            <FIELDS>
165
                <FIELD NAME="plugin" TYPE="char" LENGTH="255" NOTNULL="true" />
166
                <FIELD NAME="callfunction" TYPE="char" LENGTH="255" NOTNULL="true"  />
167 168 169 170 171 172
                <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="*" />
173 174
            </FIELDS>
            <KEYS>
175
                <KEY NAME="primary" TYPE="primary" FIELDS="plugin,callfunction" />
176
                <KEY NAME="pluginfk" TYPE="foreign" FIELDS="plugin" REFTABLE="artefact_installed" REFFIELDS="name" />
177 178
            </KEYS>
        </TABLE>
179
        <TABLE NAME="artefact_event_subscription">
180 181 182 183 184 185 186 187
            <FIELDS>
                <FIELD NAME="id" TYPE="int" LENGTH="10" SEQUENCE="true"  NOTNULL="true" />
                <FIELD NAME="plugin" TYPE="char" LENGTH="255" NOTNULL="true" />
                <FIELD NAME="event" TYPE="char" LENGTH="50" NOTNULL="true" />
                <FIELD NAME="callfunction" TYPE="char" LENGTH="255" NOTNULL="true" />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="id" />
188
                <KEY NAME="pluginfk" TYPE="foreign" FIELDS="plugin" REFTABLE="artefact_installed" REFFIELDS="name" />
Penny Leach's avatar
Penny Leach committed
189
                <KEY NAME="eventfk" TYPE="foreign" FIELDS="event" REFTABLE="event_type" REFFIELDS="name" />
190 191 192
                <KEY NAME="subscruk" TYPE="unique" FIELDS="plugin,event,callfunction" />
            </KEYS>
        </TABLE>
193
    </TABLES>
194
    <STATEMENTS>
195
        <STATEMENT NAME="insert config" TYPE="insert" TABLE="config">
196 197 198 199
            <SENTENCES>
                <SENTENCE TEXT="(field, value) VALUES ('session_timeout', 1800)" />
            </SENTENCES>
        </STATEMENT>
200
        <STATEMENT NAME="insert root user" TYPE="insert" TABLE="usr">
201 202 203 204
            <SENTENCES>
                <SENTENCE TEXT="(username, password, password_change) VALUES ('root', 'mahara', 1)"/>
            </SENTENCES>
        </STATEMENT>
Penny Leach's avatar
Penny Leach committed
205
        <STATEMENT NAME="insert events" TYPE="insert" TABLE="event_type">
206 207 208 209 210
            <SENTENCES>
                <SENTENCE TEXT="(name) VALUES ('createuser')" />
                <SENTENCE TEXT="(name) VALUES ('updateuser')" />
                <SENTENCE TEXT="(name) VALUES ('suspenduser')" />
                <SENTENCE TEXT="(name) VALUES ('deleteuser')" />
211
            </SENTENCES>
212
        </STATEMENT>
213
    </STATEMENTS>
214
</XMLDB>