Hide/show individual activities in any section
[moodle.git] / lib / db / mysql.sql
CommitLineData
93777df6 1# phpMyAdmin MySQL-Dump
2# version 2.3.0-dev
3# http://phpwizard.net/phpMyAdmin/
4# http://www.phpmyadmin.net/ (download page)
5#
6# Host: localhost
b5fe4c93 7# Generation Time: Jun 25, 2002 at 05:04 PM
93777df6 8# Server version: 3.23.49
9# PHP Version: 4.1.2
10# Database : `moodle`
11# --------------------------------------------------------
12
dafa318b 13#
14# Table structure for table `config`
15#
16
9fa49e22 17CREATE TABLE `prefix_config` (
dafa318b 18 `id` int(10) unsigned NOT NULL auto_increment,
19 `name` varchar(255) NOT NULL default '',
20 `value` varchar(255) NOT NULL default '',
21 PRIMARY KEY (`id`),
22 UNIQUE KEY `name` (`name`)
23) TYPE=MyISAM COMMENT='Moodle configuration variables';
24# --------------------------------------------------------
25
93777df6 26#
27# Table structure for table `course`
28#
29
9fa49e22 30CREATE TABLE `prefix_course` (
da5c172a 31 `id` int(10) unsigned NOT NULL auto_increment,
32 `category` int(10) unsigned NOT NULL default '0',
33 `password` varchar(50) NOT NULL default '',
34 `fullname` varchar(254) NOT NULL default '',
35 `shortname` varchar(15) NOT NULL default '',
36 `summary` text NOT NULL,
b5fe4c93 37 `format` enum('weeks','social','topics') NOT NULL default 'weeks',
d897cae4 38 `modinfo` text NOT NULL,
b5fe4c93 39 `newsitems` smallint(5) unsigned NOT NULL default '1',
da5c172a 40 `teacher` varchar(100) NOT NULL default 'Teacher',
b4d7002e 41 `teachers` varchar(100) NOT NULL default 'Teachers',
da5c172a 42 `student` varchar(100) NOT NULL default 'Student',
b4d7002e 43 `students` varchar(100) NOT NULL default 'Students',
bd2ad32f 44 `guest` tinyint(2) unsigned NOT NULL default '0',
da5c172a 45 `startdate` int(10) unsigned NOT NULL default '0',
e3f0a6a7 46 `numsections` smallint(5) unsigned NOT NULL default '1',
13beeacb 47 `showrecent` smallint(5) unsigned NOT NULL default '1',
2f21e988 48 `marker` int(10) unsigned NOT NULL default '0',
f13b00d3 49 `timecreated` int(10) unsigned NOT NULL default '0',
da5c172a 50 `timemodified` int(10) unsigned NOT NULL default '0',
51 PRIMARY KEY (`id`)
93777df6 52) TYPE=MyISAM;
53# --------------------------------------------------------
54
55#
56# Table structure for table `course_categories`
57#
58
9fa49e22 59CREATE TABLE `prefix_course_categories` (
b5fe4c93 60 `id` int(10) unsigned NOT NULL auto_increment,
61 `name` varchar(255) NOT NULL default '',
62 PRIMARY KEY (`id`),
63 UNIQUE KEY `id` (`id`)
93777df6 64) TYPE=MyISAM COMMENT='Course categories';
65# --------------------------------------------------------
66
67#
68# Table structure for table `course_modules`
69#
70
9fa49e22 71CREATE TABLE `prefix_course_modules` (
b5fe4c93 72 `id` int(10) unsigned NOT NULL auto_increment,
73 `course` int(10) unsigned NOT NULL default '0',
74 `module` int(10) unsigned NOT NULL default '0',
75 `instance` int(10) unsigned NOT NULL default '0',
76 `section` int(10) unsigned NOT NULL default '0',
77 `added` int(10) unsigned NOT NULL default '0',
78 `deleted` tinyint(1) unsigned NOT NULL default '0',
79 `score` tinyint(4) NOT NULL default '0',
1acfbce5 80 `visible` tinyint(1) NOT NULL default '1',
b5fe4c93 81 PRIMARY KEY (`id`),
82 UNIQUE KEY `id` (`id`)
93777df6 83) TYPE=MyISAM;
84# --------------------------------------------------------
85
86#
b5fe4c93 87# Table structure for table `course_sections`
93777df6 88#
89
9fa49e22 90CREATE TABLE `prefix_course_sections` (
b5fe4c93 91 `id` int(10) unsigned NOT NULL auto_increment,
92 `course` int(10) unsigned NOT NULL default '0',
93 `section` int(10) unsigned NOT NULL default '0',
7b1c0ce3 94 `summary` text NOT NULL,
b5fe4c93 95 `sequence` varchar(255) NOT NULL default '',
96 PRIMARY KEY (`id`)
93777df6 97) TYPE=MyISAM;
98# --------------------------------------------------------
99
100#
101# Table structure for table `log`
102#
103
9fa49e22 104CREATE TABLE `prefix_log` (
b5fe4c93 105 `id` int(10) unsigned NOT NULL auto_increment,
106 `time` int(10) unsigned NOT NULL default '0',
ebc3bd2b 107 `userid` int(10) unsigned NOT NULL default '0',
b5fe4c93 108 `ip` varchar(15) NOT NULL default '',
109 `course` int(10) unsigned NOT NULL default '0',
110 `module` varchar(10) NOT NULL default '',
111 `action` varchar(15) NOT NULL default '',
112 `url` varchar(100) NOT NULL default '',
113 `info` varchar(255) NOT NULL default '',
264d4e0b 114 PRIMARY KEY (`id`),
115 KEY `course` (`course`),
116 KEY `userid` (`userid`)
93777df6 117) TYPE=MyISAM COMMENT='Every action is logged as far as possible.';
118# --------------------------------------------------------
119
120#
121# Table structure for table `log_display`
122#
123
9fa49e22 124CREATE TABLE `prefix_log_display` (
65adacc4 125 `module` varchar(20) NOT NULL default '',
126 `action` varchar(20) NOT NULL default '',
565f7a95 127 `mtable` varchar(20) NOT NULL default '',
65adacc4 128 `field` varchar(40) NOT NULL default ''
565f7a95 129) TYPE=MyISAM COMMENT='For a particular module/action, specifies a moodle table/field.';
93777df6 130# --------------------------------------------------------
131
132#
133# Table structure for table `modules`
134#
135
9fa49e22 136CREATE TABLE `prefix_modules` (
b5fe4c93 137 `id` int(10) unsigned NOT NULL auto_increment,
138 `name` varchar(20) NOT NULL default '',
b5fe4c93 139 `version` int(10) NOT NULL default '0',
140 `cron` int(10) unsigned NOT NULL default '0',
141 `lastcron` int(10) unsigned NOT NULL default '0',
142 `search` varchar(255) NOT NULL default '',
143 PRIMARY KEY (`id`),
144 UNIQUE KEY `id` (`id`)
93777df6 145) TYPE=MyISAM;
146# --------------------------------------------------------
147
148#
149# Table structure for table `user`
150#
151
9fa49e22 152CREATE TABLE `prefix_user` (
b5fe4c93 153 `id` int(10) unsigned NOT NULL auto_increment,
154 `confirmed` tinyint(1) NOT NULL default '0',
01a086c3 155 `deleted` tinyint(1) NOT NULL default '0',
b5fe4c93 156 `username` varchar(100) NOT NULL default '',
157 `password` varchar(32) NOT NULL default '',
158 `idnumber` varchar(12) default NULL,
159 `firstname` varchar(20) NOT NULL default '',
160 `lastname` varchar(20) NOT NULL default '',
161 `email` varchar(100) NOT NULL default '',
162 `icq` varchar(15) default NULL,
163 `phone1` varchar(20) default NULL,
164 `phone2` varchar(20) default NULL,
165 `institution` varchar(40) default NULL,
166 `department` varchar(30) default NULL,
167 `address` varchar(70) default NULL,
168 `city` varchar(20) default NULL,
169 `country` char(2) default NULL,
c07daf5b 170 `lang` char(5) default 'en',
b5fe4c93 171 `timezone` float NOT NULL default '99',
172 `firstaccess` int(10) unsigned NOT NULL default '0',
173 `lastaccess` int(10) unsigned NOT NULL default '0',
174 `lastlogin` int(10) unsigned NOT NULL default '0',
175 `currentlogin` int(10) unsigned NOT NULL default '0',
176 `lastIP` varchar(15) default NULL,
a789fb73 177 `secret` varchar(15) default NULL,
b5fe4c93 178 `picture` tinyint(1) default NULL,
179 `url` varchar(255) default NULL,
180 `description` text,
181 `mailformat` tinyint(1) unsigned NOT NULL default '1',
bd2ad32f 182 `maildisplay` tinyint(2) unsigned NOT NULL default '2',
0095d5cd 183 `htmleditor` tinyint(1) unsigned NOT NULL default '1',
b5fe4c93 184 `timemodified` int(10) unsigned NOT NULL default '0',
185 PRIMARY KEY (`id`),
186 UNIQUE KEY `id` (`id`),
187 UNIQUE KEY `username` (`username`)
93777df6 188) TYPE=MyISAM COMMENT='One record for each person';
189# --------------------------------------------------------
190
191#
192# Table structure for table `user_admins`
193#
194
9fa49e22 195CREATE TABLE `prefix_user_admins` (
da5c172a 196 `id` int(10) unsigned NOT NULL auto_increment,
ebc3bd2b 197 `userid` int(10) unsigned NOT NULL default '0',
da5c172a 198 PRIMARY KEY (`id`),
199 UNIQUE KEY `id` (`id`)
93777df6 200) TYPE=MyISAM COMMENT='One record per administrator user';
201# --------------------------------------------------------
202
203#
204# Table structure for table `user_students`
205#
206
9fa49e22 207CREATE TABLE `prefix_user_students` (
b5fe4c93 208 `id` int(10) unsigned NOT NULL auto_increment,
ebc3bd2b 209 `userid` int(10) unsigned NOT NULL default '0',
b5fe4c93 210 `course` int(10) unsigned NOT NULL default '0',
ebc3bd2b 211 `timestart` int(10) unsigned NOT NULL default '0',
212 `timeend` int(10) unsigned NOT NULL default '0',
b5fe4c93 213 `time` int(10) unsigned NOT NULL default '0',
214 PRIMARY KEY (`id`),
215 UNIQUE KEY `id` (`id`)
93777df6 216) TYPE=MyISAM;
217# --------------------------------------------------------
218
219#
220# Table structure for table `user_teachers`
221#
222
9fa49e22 223CREATE TABLE `prefix_user_teachers` (
b5fe4c93 224 `id` int(10) unsigned NOT NULL auto_increment,
ebc3bd2b 225 `userid` int(10) unsigned NOT NULL default '0',
b5fe4c93 226 `course` int(10) unsigned NOT NULL default '0',
b4d7002e 227 `authority` int(10) NOT NULL default '3',
228 `role` varchar(40) NOT NULL default '',
b5fe4c93 229 PRIMARY KEY (`id`),
230 UNIQUE KEY `id` (`id`)
93777df6 231) TYPE=MyISAM COMMENT='One record per teacher per course';
232
1924074c 233#
234# Table structure for table `user_admins`
235#
236
237CREATE TABLE `prefix_user_coursecreators` (
238 `id` int(10) unsigned NOT NULL auto_increment,
239 `userid` int(10) unsigned NOT NULL default '0',
240 PRIMARY KEY (`id`),
241 UNIQUE KEY `id` (`id`)
242) TYPE=MyISAM COMMENT='One record per course creator';
243# --------------------------------------------------------
244
db70b54b 245INSERT INTO prefix_log_display VALUES ('user', 'view', 'user', 'CONCAT(firstname," ",lastname)');
14e4a496 246INSERT INTO prefix_log_display VALUES ('course', 'view', 'course', 'fullname');
247INSERT INTO prefix_log_display VALUES ('course', 'update', 'course', 'fullname');
db70b54b 248INSERT INTO prefix_log_display VALUES ('course', 'enrol', 'course', 'fullname');
249INSERT INTO prefix_log_display VALUES ('course', 'update', 'course', 'fullname');