MDL-11082 Improved groups upgrade performance 1.8x -> 1.9; thanks Eloy for telling...
[moodle-pu.git] / mod / wiki / db / install.xml
blob9da6bacf5ef999245a079b07a5acce92ce46e53f
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <XMLDB PATH="mod/wiki/db" VERSION="20060925" COMMENT="XMLDB file for Moodle mod/wiki"
3     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4     xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
6   <TABLES>
7     <TABLE NAME="wiki" COMMENT="Main wik table" NEXT="wiki_entries">
8       <FIELDS>
9         <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="course"/>
10         <FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="name"/>
11         <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="course" NEXT="summary"/>
12         <FIELD NAME="summary" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="pagename"/>
13         <FIELD NAME="pagename" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="summary" NEXT="wtype"/>
14         <FIELD NAME="wtype" TYPE="char" LENGTH="20" NOTNULL="true" DEFAULT="group" SEQUENCE="false" ENUM="true" ENUMVALUES="'teacher', 'group', 'student'" PREVIOUS="pagename" NEXT="ewikiprinttitle"/>
15         <FIELD NAME="ewikiprinttitle" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="wtype" NEXT="htmlmode"/>
16         <FIELD NAME="htmlmode" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="ewikiprinttitle" NEXT="ewikiacceptbinary"/>
17         <FIELD NAME="ewikiacceptbinary" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="htmlmode" NEXT="disablecamelcase"/>
18         <FIELD NAME="disablecamelcase" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="ewikiacceptbinary" NEXT="setpageflags"/>
19         <FIELD NAME="setpageflags" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="disablecamelcase" NEXT="strippages"/>
20         <FIELD NAME="strippages" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="setpageflags" NEXT="removepages"/>
21         <FIELD NAME="removepages" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="strippages" NEXT="revertchanges"/>
22         <FIELD NAME="revertchanges" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="removepages" NEXT="initialcontent"/>
23         <FIELD NAME="initialcontent" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="revertchanges" NEXT="timemodified"/>
24         <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="initialcontent"/>
25       </FIELDS>
26       <KEYS>
27         <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for wiki"/>
28       </KEYS>
29       <INDEXES>
30         <INDEX NAME="course" UNIQUE="false" FIELDS="course"/>
31       </INDEXES>
32     </TABLE>
33     <TABLE NAME="wiki_entries" COMMENT="Holds entries for each wiki start instance" PREVIOUS="wiki" NEXT="wiki_pages">
34       <FIELDS>
35         <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="wikiid"/>
36         <FIELD NAME="wikiid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="course"/>
37         <FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="wikiid" NEXT="groupid"/>
38         <FIELD NAME="groupid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="course" NEXT="userid"/>
39         <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="groupid" NEXT="pagename"/>
40         <FIELD NAME="pagename" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="timemodified"/>
41         <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="pagename"/>
42       </FIELDS>
43       <KEYS>
44         <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for wiki_entries" NEXT="wikiid"/>
45         <KEY NAME="wikiid" TYPE="foreign" FIELDS="wikiid" REFTABLE="wiki" REFFIELDS="id" PREVIOUS="primary"/>
46       </KEYS>
47       <INDEXES>
48         <INDEX NAME="course" UNIQUE="false" FIELDS="course" NEXT="gropuid"/>
49         <INDEX NAME="gropuid" UNIQUE="false" FIELDS="groupid" PREVIOUS="course" NEXT="userid"/>
50         <INDEX NAME="userid" UNIQUE="false" FIELDS="userid" PREVIOUS="gropuid" NEXT="pagename"/>
51         <INDEX NAME="pagename" UNIQUE="false" FIELDS="pagename" PREVIOUS="userid"/>
52       </INDEXES>
53     </TABLE>
54     <TABLE NAME="wiki_pages" COMMENT="Holds the Wiki-Pages" PREVIOUS="wiki_entries" NEXT="wiki_locks">
55       <FIELDS>
56         <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="pagename"/>
57         <FIELD NAME="pagename" TYPE="char" LENGTH="160" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="version"/>
58         <FIELD NAME="version" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="pagename" NEXT="flags"/>
59         <FIELD NAME="flags" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="version" NEXT="content"/>
60         <FIELD NAME="content" TYPE="text" LENGTH="medium" NOTNULL="false" SEQUENCE="false" ENUM="false" PREVIOUS="flags" NEXT="author"/>
61         <FIELD NAME="author" TYPE="char" LENGTH="100" NOTNULL="false" DEFAULT="ewiki" SEQUENCE="false" ENUM="false" PREVIOUS="content" NEXT="userid"/>
62         <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="author" NEXT="created"/>
63         <FIELD NAME="created" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="lastmodified"/>
64         <FIELD NAME="lastmodified" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="created" NEXT="refs"/>
65         <FIELD NAME="refs" TYPE="text" LENGTH="medium" NOTNULL="false" SEQUENCE="false" ENUM="false" PREVIOUS="lastmodified" NEXT="meta"/>
66         <FIELD NAME="meta" TYPE="text" LENGTH="medium" NOTNULL="false" SEQUENCE="false" ENUM="false" PREVIOUS="refs" NEXT="hits"/>
67         <FIELD NAME="hits" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="meta" NEXT="wiki"/>
68         <FIELD NAME="wiki" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="hits"/>
69       </FIELDS>
70       <KEYS>
71         <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for wiki_pages" NEXT="wiki"/>
72         <KEY NAME="wiki" TYPE="foreign" FIELDS="wiki" REFTABLE="wiki" REFFIELDS="id" PREVIOUS="primary"/>
73       </KEYS>
74       <INDEXES>
75         <INDEX NAME="pagename-version-wiki" UNIQUE="true" FIELDS="pagename, version, wiki"/>
76       </INDEXES>
77     </TABLE>
78     <TABLE NAME="wiki_locks" COMMENT="Stores editing locks on Wiki pages" PREVIOUS="wiki_pages">
79       <FIELDS>
80         <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="wikiid"/>
81         <FIELD NAME="wikiid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="pagename"/>
82         <FIELD NAME="pagename" TYPE="char" LENGTH="160" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="wikiid" NEXT="lockedby"/>
83         <FIELD NAME="lockedby" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="If the page is or was locked, this field holds the userid of the locker" PREVIOUS="pagename" NEXT="lockedsince"/>
84         <FIELD NAME="lockedsince" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Time (seconds since epoch) at which lock began" PREVIOUS="lockedby" NEXT="lockedseen"/>
85         <FIELD NAME="lockedseen" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="Time (seconds since epoch) at which lock was last reconfirmed (we ignore lock if this is &amp;gt;2 mins ago)" PREVIOUS="lockedsince"/>
86       </FIELDS>
87       <KEYS>
88         <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for wiki_locks" NEXT="wikiid"/>
89         <KEY NAME="wikiid" TYPE="foreign" FIELDS="wikiid" REFTABLE="wiki" REFFIELDS="id" PREVIOUS="primary"/>
90       </KEYS>
91       <INDEXES>
92         <INDEX NAME="wikiid-pagename" UNIQUE="true" FIELDS="wikiid, pagename" COMMENT="Main index used for retrieving locks" NEXT="lockedseen"/>
93         <INDEX NAME="lockedseen" UNIQUE="false" FIELDS="lockedseen" COMMENT="Secondary index used only during cron for deleting expired locks" PREVIOUS="wikiid-pagename"/>
94       </INDEXES>
95     </TABLE>
96   </TABLES>
97 </XMLDB>