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