data MDL-24473 corrected the data table description
[moodle.git] / mod / data / db / install.xml
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <XMLDB PATH="mod/data/db" VERSION="20100428" COMMENT="XMLDB file for Moodle mod/data"
3     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4     xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
5 >
6   <TABLES>
7     <TABLE NAME="data" COMMENT="all database activities" NEXT="data_fields">
8       <FIELDS>
9         <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="course"/>
10         <FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="name"/>
11         <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="course" NEXT="intro"/>
12         <FIELD NAME="intro" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" PREVIOUS="name" NEXT="introformat"/>
13         <FIELD NAME="introformat" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="intro" NEXT="comments"/>
14         <FIELD NAME="comments" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="introformat" NEXT="timeavailablefrom"/>
15         <FIELD NAME="timeavailablefrom" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="comments" NEXT="timeavailableto"/>
16         <FIELD NAME="timeavailableto" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="timeavailablefrom" NEXT="timeviewfrom"/>
17         <FIELD NAME="timeviewfrom" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="timeavailableto" NEXT="timeviewto"/>
18         <FIELD NAME="timeviewto" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="timeviewfrom" NEXT="requiredentries"/>
19         <FIELD NAME="requiredentries" TYPE="int" LENGTH="8" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="timeviewto" NEXT="requiredentriestoview"/>
20         <FIELD NAME="requiredentriestoview" TYPE="int" LENGTH="8" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="requiredentries" NEXT="maxentries"/>
21         <FIELD NAME="maxentries" TYPE="int" LENGTH="8" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="requiredentriestoview" NEXT="rssarticles"/>
22         <FIELD NAME="rssarticles" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="maxentries" NEXT="singletemplate"/>
23         <FIELD NAME="singletemplate" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" PREVIOUS="rssarticles" NEXT="listtemplate"/>
24         <FIELD NAME="listtemplate" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" PREVIOUS="singletemplate" NEXT="listtemplateheader"/>
25         <FIELD NAME="listtemplateheader" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" PREVIOUS="listtemplate" NEXT="listtemplatefooter"/>
26         <FIELD NAME="listtemplatefooter" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" PREVIOUS="listtemplateheader" NEXT="addtemplate"/>
27         <FIELD NAME="addtemplate" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" PREVIOUS="listtemplatefooter" NEXT="rsstemplate"/>
28         <FIELD NAME="rsstemplate" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" PREVIOUS="addtemplate" NEXT="rsstitletemplate"/>
29         <FIELD NAME="rsstitletemplate" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" PREVIOUS="rsstemplate" NEXT="csstemplate"/>
30         <FIELD NAME="csstemplate" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" PREVIOUS="rsstitletemplate" NEXT="jstemplate"/>
31         <FIELD NAME="jstemplate" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" PREVIOUS="csstemplate" NEXT="asearchtemplate"/>
32         <FIELD NAME="asearchtemplate" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" PREVIOUS="jstemplate" NEXT="approval"/>
33         <FIELD NAME="approval" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="asearchtemplate" NEXT="scale"/>
34         <FIELD NAME="scale" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" PREVIOUS="approval" NEXT="assessed"/>
35         <FIELD NAME="assessed" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="scale" NEXT="assesstimestart"/>
36         <FIELD NAME="assesstimestart" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="assessed" NEXT="assesstimefinish"/>
37         <FIELD NAME="assesstimefinish" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="assesstimestart" NEXT="defaultsort"/>
38         <FIELD NAME="defaultsort" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="assesstimefinish" NEXT="defaultsortdir"/>
39         <FIELD NAME="defaultsortdir" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="defaultsort" NEXT="editany"/>
40         <FIELD NAME="editany" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="defaultsortdir" NEXT="notification"/>
41         <FIELD NAME="notification" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="Notify people when things change" PREVIOUS="editany"/>
42       </FIELDS>
43       <KEYS>
44         <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
45       </KEYS>
46       <INDEXES>
47         <INDEX NAME="course" UNIQUE="false" FIELDS="course"/>
48       </INDEXES>
49     </TABLE>
50     <TABLE NAME="data_fields" COMMENT="every field available" PREVIOUS="data" NEXT="data_records">
51       <FIELDS>
52         <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="dataid"/>
53         <FIELD NAME="dataid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="type"/>
54         <FIELD NAME="type" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="dataid" NEXT="name"/>
55         <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="type" NEXT="description"/>
56         <FIELD NAME="description" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" PREVIOUS="name" NEXT="param1"/>
57         <FIELD NAME="param1" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" PREVIOUS="description" NEXT="param2"/>
58         <FIELD NAME="param2" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" PREVIOUS="param1" NEXT="param3"/>
59         <FIELD NAME="param3" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" PREVIOUS="param2" NEXT="param4"/>
60         <FIELD NAME="param4" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" PREVIOUS="param3" NEXT="param5"/>
61         <FIELD NAME="param5" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" PREVIOUS="param4" NEXT="param6"/>
62         <FIELD NAME="param6" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" PREVIOUS="param5" NEXT="param7"/>
63         <FIELD NAME="param7" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" PREVIOUS="param6" NEXT="param8"/>
64         <FIELD NAME="param8" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" PREVIOUS="param7" NEXT="param9"/>
65         <FIELD NAME="param9" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" PREVIOUS="param8" NEXT="param10"/>
66         <FIELD NAME="param10" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" PREVIOUS="param9"/>
67       </FIELDS>
68       <KEYS>
69         <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="dataid"/>
70         <KEY NAME="dataid" TYPE="foreign" FIELDS="dataid" REFTABLE="data" REFFIELDS="id" PREVIOUS="primary"/>
71       </KEYS>
72       <INDEXES>
73         <INDEX NAME="type-dataid" UNIQUE="false" FIELDS="type, dataid" COMMENT="used by data linking filter"/>
74       </INDEXES>
75     </TABLE>
76     <TABLE NAME="data_records" COMMENT="every record introduced" PREVIOUS="data_fields" NEXT="data_content">
77       <FIELDS>
78         <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="userid"/>
79         <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="groupid"/>
80         <FIELD NAME="groupid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="userid" NEXT="dataid"/>
81         <FIELD NAME="dataid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="groupid" NEXT="timecreated"/>
82         <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="dataid" NEXT="timemodified"/>
83         <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="timecreated" NEXT="approved"/>
84         <FIELD NAME="approved" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="timemodified"/>
85       </FIELDS>
86       <KEYS>
87         <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="dataid"/>
88         <KEY NAME="dataid" TYPE="foreign" FIELDS="dataid" REFTABLE="data" REFFIELDS="id" PREVIOUS="primary"/>
89       </KEYS>
90     </TABLE>
91     <TABLE NAME="data_content" COMMENT="the content introduced in each record/fields" PREVIOUS="data_records">
92       <FIELDS>
93         <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="fieldid"/>
94         <FIELD NAME="fieldid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="recordid"/>
95         <FIELD NAME="recordid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="fieldid" NEXT="content"/>
96         <FIELD NAME="content" TYPE="text" LENGTH="big" NOTNULL="false" SEQUENCE="false" PREVIOUS="recordid" NEXT="content1"/>
97         <FIELD NAME="content1" TYPE="text" LENGTH="big" NOTNULL="false" SEQUENCE="false" PREVIOUS="content" NEXT="content2"/>
98         <FIELD NAME="content2" TYPE="text" LENGTH="big" NOTNULL="false" SEQUENCE="false" PREVIOUS="content1" NEXT="content3"/>
99         <FIELD NAME="content3" TYPE="text" LENGTH="big" NOTNULL="false" SEQUENCE="false" PREVIOUS="content2" NEXT="content4"/>
100         <FIELD NAME="content4" TYPE="text" LENGTH="big" NOTNULL="false" SEQUENCE="false" PREVIOUS="content3"/>
101       </FIELDS>
102       <KEYS>
103         <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="recordid"/>
104         <KEY NAME="recordid" TYPE="foreign" FIELDS="recordid" REFTABLE="data_records" REFFIELDS="id" PREVIOUS="primary" NEXT="fieldid"/>
105         <KEY NAME="fieldid" TYPE="foreign" FIELDS="fieldid" REFTABLE="data_fields" REFFIELDS="id" PREVIOUS="recordid"/>
106       </KEYS>
107     </TABLE>
108   </TABLES>
109 </XMLDB>