Dropping any pretense of Postgres support for the moment, and added a README
[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
17CREATE TABLE `config` (
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
da5c172a 30CREATE TABLE `course` (
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',
38 `newsitems` smallint(5) unsigned NOT NULL default '1',
da5c172a 39 `teacher` varchar(100) NOT NULL default 'Teacher',
40 `student` varchar(100) NOT NULL default 'Student',
41 `guest` tinyint(1) unsigned NOT NULL default '0',
42 `startdate` int(10) unsigned NOT NULL default '0',
e3f0a6a7 43 `numsections` smallint(5) unsigned NOT NULL default '1',
2f21e988 44 `marker` int(10) unsigned NOT NULL default '0',
f13b00d3 45 `timecreated` int(10) unsigned NOT NULL default '0',
da5c172a 46 `timemodified` int(10) unsigned NOT NULL default '0',
47 PRIMARY KEY (`id`)
93777df6 48) TYPE=MyISAM;
49# --------------------------------------------------------
50
51#
52# Table structure for table `course_categories`
53#
54
b5fe4c93 55CREATE TABLE `course_categories` (
56 `id` int(10) unsigned NOT NULL auto_increment,
57 `name` varchar(255) NOT NULL default '',
58 PRIMARY KEY (`id`),
59 UNIQUE KEY `id` (`id`)
93777df6 60) TYPE=MyISAM COMMENT='Course categories';
61# --------------------------------------------------------
62
63#
64# Table structure for table `course_modules`
65#
66
b5fe4c93 67CREATE TABLE `course_modules` (
68 `id` int(10) unsigned NOT NULL auto_increment,
69 `course` int(10) unsigned NOT NULL default '0',
70 `module` int(10) unsigned NOT NULL default '0',
71 `instance` int(10) unsigned NOT NULL default '0',
72 `section` int(10) unsigned NOT NULL default '0',
73 `added` int(10) unsigned NOT NULL default '0',
74 `deleted` tinyint(1) unsigned NOT NULL default '0',
75 `score` tinyint(4) NOT NULL default '0',
76 PRIMARY KEY (`id`),
77 UNIQUE KEY `id` (`id`)
93777df6 78) TYPE=MyISAM;
79# --------------------------------------------------------
80
81#
b5fe4c93 82# Table structure for table `course_sections`
93777df6 83#
84
b5fe4c93 85CREATE TABLE `course_sections` (
86 `id` int(10) unsigned NOT NULL auto_increment,
87 `course` int(10) unsigned NOT NULL default '0',
88 `section` int(10) unsigned NOT NULL default '0',
89 `summary` varchar(255) NOT NULL default '',
90 `sequence` varchar(255) NOT NULL default '',
91 PRIMARY KEY (`id`)
93777df6 92) TYPE=MyISAM;
93# --------------------------------------------------------
94
95#
96# Table structure for table `log`
97#
98
b5fe4c93 99CREATE TABLE `log` (
100 `id` int(10) unsigned NOT NULL auto_increment,
101 `time` int(10) unsigned NOT NULL default '0',
102 `user` int(10) unsigned NOT NULL default '0',
103 `ip` varchar(15) NOT NULL default '',
104 `course` int(10) unsigned NOT NULL default '0',
105 `module` varchar(10) NOT NULL default '',
106 `action` varchar(15) NOT NULL default '',
107 `url` varchar(100) NOT NULL default '',
108 `info` varchar(255) NOT NULL default '',
109 PRIMARY KEY (`id`)
93777df6 110) TYPE=MyISAM COMMENT='Every action is logged as far as possible.';
111# --------------------------------------------------------
112
113#
114# Table structure for table `log_display`
115#
116
65adacc4 117CREATE TABLE `log_display` (
118 `module` varchar(20) NOT NULL default '',
119 `action` varchar(20) NOT NULL default '',
120 `table` varchar(20) NOT NULL default '',
121 `field` varchar(40) NOT NULL default ''
93777df6 122) TYPE=MyISAM COMMENT='For a particular module/action, specifies a table field.';
123# --------------------------------------------------------
124
125#
126# Table structure for table `modules`
127#
128
b5fe4c93 129CREATE TABLE `modules` (
130 `id` int(10) unsigned NOT NULL auto_increment,
131 `name` varchar(20) NOT NULL default '',
132 `fullname` varchar(255) NOT NULL default '',
133 `version` int(10) NOT NULL default '0',
134 `cron` int(10) unsigned NOT NULL default '0',
135 `lastcron` int(10) unsigned NOT NULL default '0',
136 `search` varchar(255) NOT NULL default '',
137 PRIMARY KEY (`id`),
138 UNIQUE KEY `id` (`id`)
93777df6 139) TYPE=MyISAM;
140# --------------------------------------------------------
141
142#
143# Table structure for table `user`
144#
145
b5fe4c93 146CREATE TABLE `user` (
147 `id` int(10) unsigned NOT NULL auto_increment,
148 `confirmed` tinyint(1) NOT NULL default '0',
149 `username` varchar(100) NOT NULL default '',
150 `password` varchar(32) NOT NULL default '',
151 `idnumber` varchar(12) default NULL,
152 `firstname` varchar(20) NOT NULL default '',
153 `lastname` varchar(20) NOT NULL default '',
154 `email` varchar(100) NOT NULL default '',
155 `icq` varchar(15) default NULL,
156 `phone1` varchar(20) default NULL,
157 `phone2` varchar(20) default NULL,
158 `institution` varchar(40) default NULL,
159 `department` varchar(30) default NULL,
160 `address` varchar(70) default NULL,
161 `city` varchar(20) default NULL,
162 `country` char(2) default NULL,
163 `timezone` float NOT NULL default '99',
164 `firstaccess` int(10) unsigned NOT NULL default '0',
165 `lastaccess` int(10) unsigned NOT NULL default '0',
166 `lastlogin` int(10) unsigned NOT NULL default '0',
167 `currentlogin` int(10) unsigned NOT NULL default '0',
168 `lastIP` varchar(15) default NULL,
169 `personality` varchar(5) default NULL,
170 `picture` tinyint(1) default NULL,
171 `url` varchar(255) default NULL,
172 `description` text,
173 `mailformat` tinyint(1) unsigned NOT NULL default '1',
174 `timemodified` int(10) unsigned NOT NULL default '0',
175 PRIMARY KEY (`id`),
176 UNIQUE KEY `id` (`id`),
177 UNIQUE KEY `username` (`username`)
93777df6 178) TYPE=MyISAM COMMENT='One record for each person';
179# --------------------------------------------------------
180
181#
182# Table structure for table `user_admins`
183#
184
da5c172a 185CREATE TABLE `user_admins` (
186 `id` int(10) unsigned NOT NULL auto_increment,
187 `user` int(10) unsigned NOT NULL default '0',
188 PRIMARY KEY (`id`),
189 UNIQUE KEY `id` (`id`)
93777df6 190) TYPE=MyISAM COMMENT='One record per administrator user';
191# --------------------------------------------------------
192
193#
194# Table structure for table `user_students`
195#
196
b5fe4c93 197CREATE TABLE `user_students` (
198 `id` int(10) unsigned NOT NULL auto_increment,
199 `user` int(10) unsigned NOT NULL default '0',
200 `course` int(10) unsigned NOT NULL default '0',
201 `start` int(10) unsigned NOT NULL default '0',
202 `end` int(10) unsigned NOT NULL default '0',
203 `time` int(10) unsigned NOT NULL default '0',
204 PRIMARY KEY (`id`),
205 UNIQUE KEY `id` (`id`)
93777df6 206) TYPE=MyISAM;
207# --------------------------------------------------------
208
209#
210# Table structure for table `user_teachers`
211#
212
b5fe4c93 213CREATE TABLE `user_teachers` (
214 `id` int(10) unsigned NOT NULL auto_increment,
215 `user` int(10) unsigned NOT NULL default '0',
216 `course` int(10) unsigned NOT NULL default '0',
217 `authority` varchar(10) default NULL,
218 PRIMARY KEY (`id`),
219 UNIQUE KEY `id` (`id`)
93777df6 220) TYPE=MyISAM COMMENT='One record per teacher per course';
221