install.xml 13 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="installed_artefact" COMMENT="Information about each installed artefact plugin" NEXT="installed_artefact_type">
8 9
            <FIELDS> 
                <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" NEXT="version" />
10 11 12
                <FIELD NAME="version" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="release"/>
                <FIELD NAME="release" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="version" NEXT="active"/>
                <FIELD NAME="active" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="release"/>
13 14 15 16 17
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="name" COMMENT="Primary key for installed artefact plugins" />
            </KEYS>
        </TABLE>
18 19
        <TABLE NAME="installed_artefact_type" COMMENT="Information about each installed artefact type" NEXT="installed_auth" PREVIOUS="installed_artefact">
            <FIELDS>
20 21
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" UNSIGNED="false" ENUM="false" NEXT="name" />
                <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" NEXT="plugin" PREVIOUS="id" />
22 23 24
                <FIELD NAME="plugin" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="name" />
            </FIELDS>
            <KEYS>
25 26 27
                <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for installed artefact types" NEXT="nameuk" />
                <KEY NAME="nameuk" TYPE="unique" FIELDS="name,plugin" COMMENTS="unique name, plugin" PREVIOUS="primary" NEXT="pluginfk" />
                <KEY NAME="pluginfk" TYPE="foreign" FIELDS="plugin" REFTABLE="installed_artefact" REFFIELDS="name" PREVIOUS="nameuk" />
28 29 30
            </KEYS>
        </TABLE>
        <TABLE NAME="installed_auth" COMMENT="Information about each installed authentication plugin" PREVIOUS="installed_artefact_type" NEXT="config">
31 32
            <FIELDS> 
                <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" NEXT="version" />
33 34 35
                <FIELD NAME="version" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="release"/>
                <FIELD NAME="release" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="version" NEXT="active"/>
                <FIELD NAME="active" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="release"/>
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="name" COMMENT="Primary key for installed authentication plugins" />
            </KEYS>
        </TABLE>
        <TABLE NAME="config" COMMENT="Mahara configuration variables" NEXT="config_artefact" PREVIOUS="installed_auth">
            <FIELDS>
                <FIELD NAME="field" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" NEXT="value"/>
                <FIELD NAME="value" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="field"/>
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="field" COMMENT="Primary key for config" />
            </KEYS>
        </TABLE>
        <TABLE NAME="config_artefact" COMMENT="Mahara artefact plugins configuration variables" NEXT="config_auth" PREVIOUS="config">
            <FIELDS>
                <FIELD NAME="plugin" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" ENUM="false" NEXT="field"/>
                <FIELD NAME="field" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="plugin" NEXT="value"/>
                <FIELD NAME="value" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="field"/>
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="plugin,field" COMMENT="Primary key for config_artefact" NEXT="pluginfk"/>
                <KEY NAME="pluginfk" TYPE="foreign" FIELDS="plugin" REFTABLE="installed_artefact" REFFIELDS="name" PREVIOUS="primary"/>
            </KEYS>
        </TABLE>
        <TABLE NAME="config_auth" COMMENT="Mahara authentication plugins configuration variables" NEXT="usr" PREVIOUS="config_artefact">
            <FIELDS>
                <FIELD NAME="plugin" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" ENUM="false" NEXT="field"/>
                <FIELD NAME="field" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="plugin" NEXT="value"/>
                <FIELD NAME="value" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="field"/>
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="plugin,field" COMMENT="Primary key for config_artefact" NEXT="pluginfk"/>
69
                <KEY NAME="pluginfk" TYPE="foreign" FIELDS="plugin" REFTABLE="installed_auth" REFFIELDS="name" PREVIOUS="primary"/>
70 71
            </KEYS>
        </TABLE>
72
        <TABLE NAME="usr" COMMENT="Basic user information for all system users" PREVIOUS="config_auth" NEXT="artefact">
73 74 75 76
            <FIELDS>
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="true" ENUM="false" NEXT="username"/>
                <FIELD NAME="username" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="password"/>
                <FIELD NAME="password" TYPE="char" LENGTH="40" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="username" NEXT="salt"/>
77 78
                <FIELD NAME="salt" TYPE="char" LENGTH="8" SEQUENCE="false" ENUM="false" PREVIOUS="password" NEXT="password_change"/>
                <FIELD NAME="password_change" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="salt"/>
79 80 81 82 83 84 85 86
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for usr"/>
            </KEYS>
            <INDEXES>
                <INDEX NAME="usernameuk" UNIQUE="true" FIELDS="LOWER(username)"/>
            </INDEXES>
        </TABLE>
87
        <TABLE NAME="artefact" COMMENT="Basic information common to all artefact plugin instances" PREVIOUS="usr" NEXT="cron">
88
            <FIELDS>
89 90 91
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="true" ENUM="false" NEXT="artefacttype" />
                <FIELD NAME="artefacttype" TYPE="char" LENGTH="255" NOTNULL="true" ENUM="false" PREVIOUS="id" NEXT="container" />
                <FIELD NAME="container" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" UNSIGNED="false" SEQUENCE="false" ENUM="false" PREVIOUS="artefacttype" NEXT="parentid" />
92 93 94 95 96 97 98 99 100 101
                <FIELD NAME="parentid" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="false" SEQUENCE="false" ENUM="false" PREVIOUS="container" NEXT="ctime" />
                <FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" PREVIOUS="parentid" NEXT="mtime" />
                <FIELD NAME="mtime" TYPE="datetime" NOTNULL="true" PREVIOUS="ctime" NEXT="vtime" />
                <FIELD NAME="vtime" TYPE="datetime" NOTNULL="true" PREVIOUS="mtime" NEXT="locked" />
                <FIELD NAME="locked" TYPE="int" LENGTH="1" NOTNULL="true" DEFAULT="0" PREVIOUS="vtime" NEXT="title" />
                <FIELD NAME="title" TYPE="text" NOTNULL="true" PREVIOUS="locked" NEXT="description" />
                <FIELD NAME="description" TYPE="text" NOTNULL="false" PREVIOUS="title" NEXT="note" />
                <FIELD NAME="note" TYPE="text" NOTNULL="false" PREVIOUS="description"/>
            </FIELDS>
            <KEYS>
Penny Leach's avatar
Penny Leach committed
102
                <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="typefk" />
103
                <KEY NAME="typefk" TYPE="foreign" FIELDS="artefacttype" REFTABLE="installed_artefact_type" REFFIELDS="id" PREVIOUS="primary" NEXT="parentfk" />
Penny Leach's avatar
Penny Leach committed
104
                <KEY NAME="parentfk" TYPE="foreign" FIELDS="parentid" REFTABLE="artefact" REFFIELDS="id" PREVIOUS="typefk" />
105 106
            </KEYS>
        </TABLE>
107 108 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 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153
        <TABLE NAME="cron" COMMENT="cron entries for the core" PREVIOUS="artefact" NEXT="cron_artefact">
            <FIELDS>
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="true" ENUM="false" NEXT="function" />
                <FIELD NAME="function" TYPE="char" LENGTH="255" NOTNULL="true" PREVIOUS="id" NEXT="nextrun" />
                <FIELD NAME="nextrun" TYPE="datetime" NOTNULL="false" UNSIGNED="false" SEQUENCE="false" ENUM="false" PREVIOUS="function" NEXT="minute" />
                <FIELD NAME="minute" TYPE="char" LENGTH="25" NOTNULL="true" DEFAULT="*" PREVIOUS="nextrun" NEXT="hour" />
                <FIELD NAME="hour" TYPE="char" LENGTH="25" NOTNULL="true" DEFAULT="*" PREVIOUS="minute" NEXT="day" />
                <FIELD NAME="day" TYPE="char" LENGTH="25" NOTNULL="true" DEFAULT="*" PREVIOUS="hour" NEXT="month" />
                <FIELD NAME="month" TYPE="char" LENGTH="25" NOTNULL="true" DEFAULT="*" PREVIOUS="day" NEXT="dayofweek" />
                <FIELD NAME="dayofweek" TYPE="char" LENGTH="25" NOTNULL="true" DEFAULT="*" PREVIOUS="month" />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="function" />
            </KEYS>
        </TABLE>
        <TABLE NAME="cron_artefact" COMMENT="cron entries for the artefact plugins" PREVIOUS="cron" NEXT="cron_auth">
            <FIELDS>
                <FIELD NAME="plugin" TYPE="char" LENGTH="255" NOTNULL="true" NEXT="function" />
                <FIELD NAME="function" TYPE="char" LENGTH="255" NOTNULL="true" PREVIOUS="plugin" NEXT="nextrun" />
                <FIELD NAME="nextrun" TYPE="datetime" NOTNULL="false" UNSIGNED="false" SEQUENCE="false" ENUM="false" PREVIOUS="function" NEXT="minute" />
                <FIELD NAME="minute" TYPE="char" LENGTH="25" NOTNULL="true" DEFAULT="*" PREVIOUS="nextrun" NEXT="hour" />
                <FIELD NAME="hour" TYPE="char" LENGTH="25" NOTNULL="true" DEFAULT="*" PREVIOUS="minute" NEXT="day" />
                <FIELD NAME="day" TYPE="char" LENGTH="25" NOTNULL="true" DEFAULT="*" PREVIOUS="hour" NEXT="month" />
                <FIELD NAME="month" TYPE="char" LENGTH="25" NOTNULL="true" DEFAULT="*" PREVIOUS="day" NEXT="dayofweek" />
                <FIELD NAME="dayofweek" TYPE="char" LENGTH="25" NOTNULL="true" DEFAULT="*" PREVIOUS="month" />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="plugin,function" NEXT="pluginfk" />
                <KEY NAME="pluginfk" TYPE="foreign" FIELDS="plugin" REFTABLE="installed_artefact" REFFIELDS="name" PREVIOUS="primary" />
            </KEYS>
        </TABLE>
        <TABLE NAME="cron_auth" COMMENT="cron entries for the auth plugins" PREVIOUS="cron_artefact">
            <FIELDS>
                <FIELD NAME="plugin" TYPE="char" LENGTH="255" NOTNULL="true" NEXT="function" />
                <FIELD NAME="function" TYPE="char" LENGTH="255" NOTNULL="true" PREVIOUS="plugin" NEXT="nextrun" />
                <FIELD NAME="nextrun" TYPE="datetime" NOTNULL="false" UNSIGNED="false" SEQUENCE="false" ENUM="false" PREVIOUS="function" NEXT="minute" />
                <FIELD NAME="minute" TYPE="char" LENGTH="25" NOTNULL="true" DEFAULT="*" PREVIOUS="nextrun" NEXT="hour" />
                <FIELD NAME="hour" TYPE="char" LENGTH="25" NOTNULL="true" DEFAULT="*" PREVIOUS="minute" NEXT="day" />
                <FIELD NAME="day" TYPE="char" LENGTH="25" NOTNULL="true" DEFAULT="*" PREVIOUS="hour" NEXT="month" />
                <FIELD NAME="month" TYPE="char" LENGTH="25" NOTNULL="true" DEFAULT="*" PREVIOUS="day" NEXT="dayofweek" />
                <FIELD NAME="dayofweek" TYPE="char" LENGTH="25" NOTNULL="true" DEFAULT="*" PREVIOUS="month" />
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="plugin,function" NEXT="pluginfk" />
                <KEY NAME="pluginfk" TYPE="foreign" FIELDS="plugin" REFTABLE="installed_auth" REFFIELDS="name" PREVIOUS="primary" />
            </KEYS>
        </TABLE>
154
    </TABLES>
155 156 157 158 159 160 161 162 163 164 165 166
    <STATEMENTS>
        <STATEMENT NAME="insert config" TYPE="insert" TABLE="config" COMMENT="Initial insert of records on table config" NEXT="insert root user">
            <SENTENCES>
                <SENTENCE TEXT="(field, value) VALUES ('session_timeout', 1800)" />
            </SENTENCES>
        </STATEMENT>
        <STATEMENT NAME="insert root user" TYPE="insert" TABLE="usr" COMMENT="Inserting the root user" PREVIOUS="insert config">
            <SENTENCES>
                <SENTENCE TEXT="(username, password, password_change) VALUES ('root', 'mahara', 1)"/>
            </SENTENCES>
        </STATEMENT>
    </STATEMENTS>
167
</XMLDB>