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