new strings
[moodle.git] / lib / db / postgres7.sql
CommitLineData
bb209a3e 1------------------------------------------------------------------
2-- My2Pg 1.24 translated dump
3--
4------------------------------------------------------------------
5
6BEGIN;
7
8
9
10
11--
12-- Sequences for table COURSE
13--
14
15CREATE SEQUENCE course_id_seq;
16
93777df6 17-- phpMyAdmin MySQL-Dump
18-- version 2.3.0-dev
19-- http://phpwizard.net/phpMyAdmin/
20-- http://www.phpmyadmin.net/ (download page)
21--
22-- Host: localhost
23-- Generation Time: May 29, 2002 at 05:19 PM
24-- Server version: 3.23.49
25-- PHP Version: 4.1.2
26-- Database : `moodle`
27-- --------------------------------------------------------
28
29--
30-- Table structure for table `course`
31--
32
33CREATE TABLE course (
34 id INT4 DEFAULT nextval('course_id_seq'),
35 category INT4 NOT NULL DEFAULT '0',
36 password varchar(50) NOT NULL DEFAULT '',
37 fullname varchar(254) NOT NULL DEFAULT '',
38 shortname varchar(15) NOT NULL DEFAULT '',
39 summary TEXT DEFAULT '' NOT NULL,
40 format INT2 NOT NULL DEFAULT '1',
41 teacher varchar(100) NOT NULL DEFAULT 'Teacher',
42 startdate INT4 NOT NULL DEFAULT '0',
43 enddate INT4 NOT NULL DEFAULT '0',
44 timemodified INT4 NOT NULL DEFAULT '0',
45 PRIMARY KEY (id)
bb209a3e 46);
93777df6 47-- --------------------------------------------------------
48
49--
50-- Table structure for table `course_categories`
51--
52
bb209a3e 53
54
55--
56-- Sequences for table COURSE_CATEGORIES
57--
58
59CREATE SEQUENCE course_categories_id_seq;
60
93777df6 61CREATE TABLE course_categories (
62 id INT4 DEFAULT nextval('course_categories_id_seq'),
63 name varchar(255) NOT NULL DEFAULT '',
64 PRIMARY KEY (id)
bb209a3e 65);
93777df6 66-- --------------------------------------------------------
67
68--
69-- Table structure for table `course_modules`
70--
71
bb209a3e 72
73
74--
75-- Sequences for table COURSE_MODULES
76--
77
78CREATE SEQUENCE course_modules_id_seq;
79
93777df6 80CREATE TABLE course_modules (
81 id INT4 DEFAULT nextval('course_modules_id_seq'),
82 course INT4 NOT NULL DEFAULT '0',
83 module INT4 NOT NULL DEFAULT '0',
84 instance INT4 NOT NULL DEFAULT '0',
85 week INT4 NOT NULL DEFAULT '0',
86 added INT4 NOT NULL DEFAULT '0',
87 deleted INT2 NOT NULL DEFAULT '0',
88 score INT2 NOT NULL DEFAULT '0',
89 PRIMARY KEY (id)
bb209a3e 90);
93777df6 91-- --------------------------------------------------------
92
93--
94-- Table structure for table `course_weeks`
95--
96
bb209a3e 97
98
99--
100-- Sequences for table COURSE_WEEKS
101--
102
103CREATE SEQUENCE course_weeks_id_seq;
104
93777df6 105CREATE TABLE course_weeks (
106 id INT4 DEFAULT nextval('course_weeks_id_seq'),
107 course INT4 NOT NULL DEFAULT '0',
108 week INT4 NOT NULL DEFAULT '0',
109 summary varchar(255) NOT NULL DEFAULT '',
110 sequence varchar(255) NOT NULL DEFAULT '',
111 PRIMARY KEY (id)
bb209a3e 112);
93777df6 113-- --------------------------------------------------------
114
115--
116-- Table structure for table `log`
117--
118
bb209a3e 119
120
121--
93777df6 122-- Sequences for table LOG
bb209a3e 123--
124
93777df6 125CREATE SEQUENCE log_id_seq;
bb209a3e 126
93777df6 127CREATE TABLE log (
128 id INT4 DEFAULT nextval('log_id_seq'),
129 time INT4 NOT NULL DEFAULT '0',
130 user INT4 NOT NULL DEFAULT '0',
131 ip varchar(15) NOT NULL DEFAULT '',
132 course INT4 NOT NULL DEFAULT '0',
133 module varchar(10) NOT NULL DEFAULT '',
134 action varchar(15) NOT NULL DEFAULT '',
135 url varchar(100) NOT NULL DEFAULT '',
136 info varchar(255) NOT NULL DEFAULT '',
137 PRIMARY KEY (id)
bb209a3e 138);
93777df6 139-- --------------------------------------------------------
140
141--
142-- Table structure for table `log_display`
143--
144
145CREATE TABLE log_display (
146 module varchar(20) NOT NULL DEFAULT '',
147 action varchar(20) NOT NULL DEFAULT '',
148 table varchar(20) NOT NULL DEFAULT '',
149 field varchar(40) NOT NULL DEFAULT ''
150);
151-- --------------------------------------------------------
152
153--
154-- Table structure for table `modules`
155--
156
bb209a3e 157
158
159--
160-- Sequences for table MODULES
161--
162
163CREATE SEQUENCE modules_id_seq;
164
93777df6 165CREATE TABLE modules (
166 id INT4 DEFAULT nextval('modules_id_seq'),
167 name varchar(20) NOT NULL DEFAULT '',
168 fullname varchar(255) NOT NULL DEFAULT '',
169 version INT4 NOT NULL DEFAULT '0',
170 cron INT4 NOT NULL DEFAULT '0',
171 lastcron INT4 NOT NULL DEFAULT '0',
172 search varchar(255) NOT NULL DEFAULT '',
173 PRIMARY KEY (id)
bb209a3e 174);
93777df6 175-- --------------------------------------------------------
176
177--
178-- Table structure for table `user`
179--
180
bb209a3e 181
182
183--
184-- Sequences for table USER
185--
186
187CREATE SEQUENCE user_id_seq;
188
93777df6 189CREATE TABLE user (
190 id INT4 DEFAULT nextval('user_id_seq'),
191 confirmed INT2 NOT NULL DEFAULT '0',
192 username varchar(100) NOT NULL DEFAULT '',
193 password varchar(32) NOT NULL DEFAULT '',
194 idnumber varchar(12) DEFAULT NULL,
195 firstname varchar(20) NOT NULL DEFAULT '',
196 lastname varchar(20) NOT NULL DEFAULT '',
197 email varchar(100) NOT NULL DEFAULT '',
198 icq varchar(15) DEFAULT NULL,
199 phone1 varchar(20) DEFAULT NULL,
200 phone2 varchar(20) DEFAULT NULL,
201 institution varchar(40) DEFAULT NULL,
202 department varchar(30) DEFAULT NULL,
203 address varchar(70) DEFAULT NULL,
204 city varchar(20) DEFAULT NULL,
205 country char(2) DEFAULT NULL,
206 firstaccess INT4 NOT NULL DEFAULT '0',
207 lastaccess INT4 NOT NULL DEFAULT '0',
208 lastlogin INT4 NOT NULL DEFAULT '0',
209 currentlogin INT4 NOT NULL DEFAULT '0',
210 lastIP varchar(15) DEFAULT NULL,
211 personality varchar(5) DEFAULT NULL,
212 picture INT2 DEFAULT NULL,
213 url varchar(255) DEFAULT NULL,
214 description text,
215 research INT2 NOT NULL DEFAULT '0',
216 forwardmail INT2 NOT NULL DEFAULT '0',
217 timemodified INT4 NOT NULL DEFAULT '0',
218 PRIMARY KEY (id)
27dd018c 219);
93777df6 220-- --------------------------------------------------------
221
222--
223-- Table structure for table `user_admins`
224--
225
bb209a3e 226
227
228--
229-- Sequences for table USER_ADMINS
230--
231
232CREATE SEQUENCE user_admins_id_seq;
233
93777df6 234CREATE TABLE user_admins (
235 id INT4 DEFAULT nextval('user_admins_id_seq'),
236 user INT4 NOT NULL DEFAULT '0',
237 PRIMARY KEY (id)
bb209a3e 238);
93777df6 239-- --------------------------------------------------------
240
241--
242-- Table structure for table `user_students`
243--
244
bb209a3e 245
27dd018c 246
247--
bb209a3e 248-- Sequences for table USER_STUDENTS
27dd018c 249--
250
bb209a3e 251CREATE SEQUENCE user_students_id_seq;
252
93777df6 253CREATE TABLE user_students (
254 id INT4 DEFAULT nextval('user_students_id_seq'),
255 user INT4 NOT NULL DEFAULT '0',
256 course INT4 NOT NULL DEFAULT '0',
257 start INT4 NOT NULL DEFAULT '0',
258 end INT4 NOT NULL DEFAULT '0',
259 time INT4 NOT NULL DEFAULT '0',
260 PRIMARY KEY (id)
bb209a3e 261);
93777df6 262-- --------------------------------------------------------
263
264--
265-- Table structure for table `user_teachers`
266--
267
bb209a3e 268
269
270--
271-- Sequences for table USER_TEACHERS
272--
273
274CREATE SEQUENCE user_teachers_id_seq;
275
93777df6 276CREATE TABLE user_teachers (
277 id INT4 DEFAULT nextval('user_teachers_id_seq'),
278 user INT4 NOT NULL DEFAULT '0',
279 course INT4 NOT NULL DEFAULT '0',
280 authority varchar(10) DEFAULT NULL,
281 PRIMARY KEY (id)
27dd018c 282);
93777df6 283
284
285
286
bb209a3e 287
288
289--
290-- Indexes for table USER_TEACHERS
291--
292
93777df6 293CREATE UNIQUE INDEX id_user_teachers_index ON user_teachers (id);
bb209a3e 294
295--
296-- Indexes for table COURSE_CATEGORIES
297--
298
93777df6 299CREATE UNIQUE INDEX id_course_categories_index ON course_categories (id);
bb209a3e 300
301--
302-- Indexes for table USER_STUDENTS
303--
304
93777df6 305CREATE UNIQUE INDEX id_user_students_index ON user_students (id);
bb209a3e 306
307--
308-- Indexes for table MODULES
309--
310
93777df6 311CREATE UNIQUE INDEX id_modules_index ON modules (id);
bb209a3e 312
313--
314-- Indexes for table USER
315--
316
93777df6 317CREATE UNIQUE INDEX id_user_index ON user (id);
318CREATE UNIQUE INDEX username_user_index ON user (username);
bb209a3e 319
320--
321-- Indexes for table USER_ADMINS
322--
323
93777df6 324CREATE UNIQUE INDEX id_user_admins_index ON user_admins (id);
bb209a3e 325
326--
327-- Indexes for table COURSE_MODULES
328--
329
93777df6 330CREATE UNIQUE INDEX id_course_modules_index ON course_modules (id);
bb209a3e 331
332--
333-- Sequences for table USER_TEACHERS
334--
335
93777df6 336SELECT SETVAL('user_teachers_id_seq',(select case when max(id)>0 then max(id)+1 else 1 end from user_teachers));
bb209a3e 337
338--
339-- Sequences for table USER_STUDENTS
340--
341
93777df6 342SELECT SETVAL('user_students_id_seq',(select case when max(id)>0 then max(id)+1 else 1 end from user_students));
343
344--
345-- Sequences for table LOG
346--
347
348SELECT SETVAL('log_id_seq',(select case when max(id)>0 then max(id)+1 else 1 end from log));
bb209a3e 349
350--
351-- Sequences for table MODULES
352--
353
93777df6 354SELECT SETVAL('modules_id_seq',(select case when max(id)>0 then max(id)+1 else 1 end from modules));
bb209a3e 355
356--
357-- Sequences for table USER
358--
359
93777df6 360SELECT SETVAL('user_id_seq',(select case when max(id)>0 then max(id)+1 else 1 end from user));
bb209a3e 361
362--
363-- Sequences for table COURSE
364--
365
93777df6 366SELECT SETVAL('course_id_seq',(select case when max(id)>0 then max(id)+1 else 1 end from course));
bb209a3e 367
368--
369-- Sequences for table USER_ADMINS
370--
371
93777df6 372SELECT SETVAL('user_admins_id_seq',(select case when max(id)>0 then max(id)+1 else 1 end from user_admins));
bb209a3e 373
374--
375-- Sequences for table COURSE_CATEGORIES
376--
377
93777df6 378SELECT SETVAL('course_categories_id_seq',(select case when max(id)>0 then max(id)+1 else 1 end from course_categories));
bb209a3e 379
380--
381-- Sequences for table COURSE_WEEKS
382--
383
93777df6 384SELECT SETVAL('course_weeks_id_seq',(select case when max(id)>0 then max(id)+1 else 1 end from course_weeks));
bb209a3e 385
386--
387-- Sequences for table COURSE_MODULES
388--
27dd018c 389
93777df6 390SELECT SETVAL('course_modules_id_seq',(select case when max(id)>0 then max(id)+1 else 1 end from course_modules));
27dd018c 391
bb209a3e 392COMMIT;