MDL-14493 First checkin of Feedback module into HEAD.
[moodle.git] / mod / feedback / db / install.xml
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <XMLDB PATH="mod/feedback/db" VERSION="20070101" COMMENT="XMLDB file for Moodle mod/feedback">
3   <TABLES>
4     <TABLE NAME="feedback" COMMENT="all feedbacks" NEXT="feedback_template">
5       <FIELDS>
6         <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="course"/>
7         <FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="name"/>
8         <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="course" NEXT="summary"/>
9         <FIELD NAME="summary" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="anonymous"/>
10         <FIELD NAME="anonymous" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="summary" NEXT="email_notification"/>
11         <FIELD NAME="email_notification" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="anonymous" NEXT="multiple_submit"/>
12         <FIELD NAME="multiple_submit" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="email_notification" NEXT="page_after_submit"/>
13         <FIELD NAME="page_after_submit" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="multiple_submit" NEXT="publish_stats"/>
14         <FIELD NAME="publish_stats" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="page_after_submit" NEXT="timeopen"/>
15         <FIELD NAME="timeopen" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="publish_stats" NEXT="timeclose"/>
16         <FIELD NAME="timeclose" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timeopen" NEXT="timemodified"/>
17         <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timeclose"/>
18       </FIELDS>
19       <KEYS>
20         <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for feedback"/>
21       </KEYS>
22       <INDEXES>
23         <INDEX NAME="course" UNIQUE="false" FIELDS="course"/>
24       </INDEXES>
25     </TABLE>
26     <TABLE NAME="feedback_template" COMMENT="templates of feedbackstructures" PREVIOUS="feedback" NEXT="feedback_item">
27       <FIELDS>
28         <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="course"/>
29         <FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="ispublic"/>
30         <FIELD NAME="ispublic" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="course" NEXT="name"/>
31         <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="ispublic"/>
32       </FIELDS>
33       <KEYS>
34         <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for feedback_template"/>
35       </KEYS>
36       <INDEXES>
37         <INDEX NAME="course" UNIQUE="false" FIELDS="course"/>
38       </INDEXES>
39     </TABLE>
40     <TABLE NAME="feedback_item" COMMENT="feedback_items" PREVIOUS="feedback_template" NEXT="feedback_completed">
41       <FIELDS>
42         <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="feedback"/>
43         <FIELD NAME="feedback" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="template"/>
44         <FIELD NAME="template" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="feedback" NEXT="name"/>
45         <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="template" NEXT="presentation"/>
46         <FIELD NAME="presentation" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="typ"/>
47         <FIELD NAME="typ" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="presentation" NEXT="hasvalue"/>
48         <FIELD NAME="hasvalue" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="typ" NEXT="position"/>
49         <FIELD NAME="position" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="hasvalue" NEXT="required"/>
50         <FIELD NAME="required" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="position"/>
51       </FIELDS>
52       <KEYS>
53         <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for feedback_item" NEXT="feedback"/>
54         <KEY NAME="feedback" TYPE="foreign" FIELDS="feedback" REFTABLE="feedback" REFFIELDS="id" PREVIOUS="primary" NEXT="template"/>
55         <KEY NAME="template" TYPE="foreign" FIELDS="template" REFTABLE="feedback_template" REFFIELDS="id" PREVIOUS="feedback"/>
56       </KEYS>
57     </TABLE>
58     <TABLE NAME="feedback_completed" COMMENT="filled out feedback" PREVIOUS="feedback_item" NEXT="feedback_completedtmp">
59       <FIELDS>
60         <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="feedback"/>
61         <FIELD NAME="feedback" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="userid"/>
62         <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="feedback" NEXT="timemodified"/>
63         <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="random_response"/>
64         <FIELD NAME="random_response" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timemodified" NEXT="anonymous_response"/>
65         <FIELD NAME="anonymous_response" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="random_response"/>
66       </FIELDS>
67       <KEYS>
68         <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for feedback_completed" NEXT="feedback"/>
69         <KEY NAME="feedback" TYPE="foreign" FIELDS="feedback" REFTABLE="feedback" REFFIELDS="id" PREVIOUS="primary"/>
70       </KEYS>
71       <INDEXES>
72         <INDEX NAME="userid" UNIQUE="false" FIELDS="userid"/>
73       </INDEXES>
74     </TABLE>
75     <TABLE NAME="feedback_completedtmp" COMMENT="filled out feedback" PREVIOUS="feedback_completed" NEXT="feedback_value">
76       <FIELDS>
77         <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="feedback"/>
78         <FIELD NAME="feedback" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="userid"/>
79         <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="feedback" NEXT="guestid"/>
80         <FIELD NAME="guestid" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="timemodified"/>
81         <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="guestid" NEXT="random_response"/>
82         <FIELD NAME="random_response" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timemodified" NEXT="anonymous_response"/>
83         <FIELD NAME="anonymous_response" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="random_response"/>
84       </FIELDS>
85       <KEYS>
86         <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for feedback_completedtmp" NEXT="feedback"/>
87         <KEY NAME="feedback" TYPE="foreign" FIELDS="feedback" REFTABLE="feedback" REFFIELDS="id" PREVIOUS="primary"/>
88       </KEYS>
89       <INDEXES>
90         <INDEX NAME="userid" UNIQUE="false" FIELDS="userid"/>
91       </INDEXES>
92     </TABLE>
93     <TABLE NAME="feedback_value" COMMENT="values of the completeds" PREVIOUS="feedback_completedtmp" NEXT="feedback_valuetmp">
94       <FIELDS>
95         <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="course_id"/>
96         <FIELD NAME="course_id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="item"/>
97         <FIELD NAME="item" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="course_id" NEXT="completed"/>
98         <FIELD NAME="completed" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="item" NEXT="tmp_completed"/>
99         <FIELD NAME="tmp_completed" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="completed" NEXT="value"/>
100         <FIELD NAME="value" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="tmp_completed"/>
101       </FIELDS>
102       <KEYS>
103         <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for feedback_value" NEXT="item"/>
104         <KEY NAME="item" TYPE="foreign" FIELDS="item" REFTABLE="feedback_item" REFFIELDS="id" PREVIOUS="primary"/>
105       </KEYS>
106       <INDEXES>
107         <INDEX NAME="course_id" UNIQUE="false" FIELDS="course_id"/>
108       </INDEXES>
109     </TABLE>
110     <TABLE NAME="feedback_valuetmp" COMMENT="values of the completedstmp" PREVIOUS="feedback_value" NEXT="feedback_tracking">
111       <FIELDS>
112         <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="course_id"/>
113         <FIELD NAME="course_id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="item"/>
114         <FIELD NAME="item" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="course_id" NEXT="completed"/>
115         <FIELD NAME="completed" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="item" NEXT="tmp_completed"/>
116         <FIELD NAME="tmp_completed" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="completed" NEXT="value"/>
117         <FIELD NAME="value" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="tmp_completed"/>
118       </FIELDS>
119       <KEYS>
120         <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for feedback_valuetmp" NEXT="item"/>
121         <KEY NAME="item" TYPE="foreign" FIELDS="item" REFTABLE="feedback_item" REFFIELDS="id" PREVIOUS="primary"/>
122       </KEYS>
123       <INDEXES>
124         <INDEX NAME="course_id" UNIQUE="false" FIELDS="course_id"/>
125       </INDEXES>
126     </TABLE>
127     <TABLE NAME="feedback_tracking" COMMENT="feedback trackingdata" PREVIOUS="feedback_valuetmp" NEXT="feedback_sitecourse_map">
128       <FIELDS>
129         <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="userid"/>
130         <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="feedback"/>
131         <FIELD NAME="feedback" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="completed"/>
132         <FIELD NAME="completed" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="feedback" NEXT="tmp_completed"/>
133         <FIELD NAME="tmp_completed" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="completed" NEXT="count"/>
134         <FIELD NAME="count" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="tmp_completed"/>
135       </FIELDS>
136       <KEYS>
137         <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for feedback_tracking" NEXT="feedback"/>
138         <KEY NAME="feedback" TYPE="foreign" FIELDS="feedback" REFTABLE="feedback" REFFIELDS="id" PREVIOUS="primary" NEXT="completed"/>
139         <KEY NAME="completed" TYPE="foreign" FIELDS="completed" REFTABLE="feedback_completed" REFFIELDS="id" PREVIOUS="feedback"/>
140       </KEYS>
141       <INDEXES>
142         <INDEX NAME="userid" UNIQUE="false" FIELDS="userid"/>
143       </INDEXES>
144     </TABLE>
145     <TABLE NAME="feedback_sitecourse_map" COMMENT="feedback sitecourse map" PREVIOUS="feedback_tracking">
146       <FIELDS>
147         <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="feedbackid"/>
148         <FIELD NAME="feedbackid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="courseid"/>
149         <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="feedbackid"/>
150       </FIELDS>
151       <KEYS>
152         <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for feedback_tracking" NEXT="feedbackid"/>
153         <KEY NAME="feedbackid" TYPE="foreign" FIELDS="feedbackid" REFTABLE="feedback" REFFIELDS="id" PREVIOUS="primary"/>
154       </KEYS>
155       <INDEXES>
156         <INDEX NAME="courseid" UNIQUE="false" FIELDS="courseid"/>
157       </INDEXES>
158     </TABLE>
159   </TABLES>
160 </XMLDB>