install.xml 7.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 7 8 9
    <TABLES>
        <TABLE NAME="installed_artefact" COMMENT="Information about each installed artefact plugin" NEXT="installed_auth">
            <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 18 19 20
            </FIELDS>
            <KEYS>
                <KEY NAME="primary" TYPE="primary" FIELDS="name" COMMENT="Primary key for installed artefact plugins" />
            </KEYS>
        </TABLE>
        <TABLE NAME="installed_auth" COMMENT="Information about each installed authentication plugin" PREVIOUS="installed_artefact" NEXT="config">
            <FIELDS> 
                <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" NEXT="version" />
21 22 23
                <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"/>
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
            </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"/>
57
                <KEY NAME="pluginfk" TYPE="foreign" FIELDS="plugin" REFTABLE="installed_auth" REFFIELDS="name" PREVIOUS="primary"/>
58 59
            </KEYS>
        </TABLE>
60
        <TABLE NAME="usr" COMMENT="Basic user information for all system users" PREVIOUS="config_auth" NEXT="artefact">
61 62 63 64
            <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"/>
65 66
                <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"/>
67 68 69 70 71 72 73 74
            </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>
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
        <TABLE NAME="artefact" COMMENT="Basic information common to all artefact plugin instances" PREVIOUS="usr">
            <FIELDS>
                <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" SEQUENCE="true" ENUM="false" NEXT="type" />
                <FIELD NAME="type" 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="type" NEXT="parentid" />
                <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>
                <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="pluginfk" />
                <KEY NAME="pluginfk" TYPE="foreign" FIELDS="type" REFTABLE="installed_artefact" REFFIELDS="name" PREVIOUS="primary" />
            </KEYS>
        </TABLE>
94
    </TABLES>
95 96 97 98 99 100 101 102 103 104 105 106
    <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>
107
</XMLDB>