Some blank index.html files to prevent browsing
[moodle.git] / lib / db / oci8po.sql
CommitLineData
96c1e116 1rem DRAFT DRAFT DRAFT DRAFT - untested\r
2\r
3rem\r
4rem Table structure for table config\r
5rem\r
6\r
7drop TABLE prefix_config;\r
8CREATE TABLE prefix_config (\r
9 id number(10) primary key,\r
10 name varchar2(255) default '' not null constraint unq_name unique,\r
11 value varchar2(255) default '' not null\r
12);\r
13\r
14COMMENT on table prefix_config is 'Moodle configuration variables';\r
15\r
16drop sequence p_config_seq;\r
17create sequence p_config_seq;\r
18\r
19create or replace trigger p_config_trig\r
20 before insert on prefix_config\r
21 referencing new as new_row\r
22 for each row\r
23 begin\r
24 select p_config_seq.nextval into :new_row.id from dual;\r
25 end;\r
26.\r
27/\r
28\r
29insert into prefix_config (name,value) values ('Name1','Value1');\r
30insert into prefix_config (name,value) values ('Name2','Value2');\r
31insert into prefix_config (name,value) values ('Name3','Value3');\r
32\r
33rem testing unique column constraint on name: this should fail\r
34insert into prefix_config (name,value) values ('Name1','Value4');\r
35\r
36\r
37select * from prefix_config order by 1,2;\r
38\r
39rem --------------------------------------------------------\r
40\r
41rem\r
42rem Table structure for table course\r
43rem\r
44\r
45drop TABLE prefix_course;\r
46CREATE TABLE prefix_course (\r
47 id number(10) primary key,\r
48 category number(10) default '0' not null,\r
49 sortorder number(10) default '0' not null,\r
50 password varchar2(50) default '' not null,\r
51 fullname varchar2(254) default '' not null,\r
52 shortname varchar2(15) default '' not null,\r
53 summary varchar2(254) not null,\r
54 format varchar2(10) default 'topics' not null,\r
55 showgrades number(2) default '1' not null,\r
56 modinfo varchar2(1024) not null,\r
57 newsitems number(5) default '1' not null,\r
58 teacher varchar2(100) default 'Teacher' not null,\r
59 teachers varchar2(100) default 'Teachers' not null,\r
60 student varchar2(100) default 'Student' not null,\r
61 students varchar2(100) default 'Students' not null,\r
62 guest number(2) default '0' not null,\r
63 startdate number(10) default '0' not null,\r
64 numsections number(5) default '1' not null,\r
65 showrecent number(5) default '1' not null,\r
66 marker number(10) default '0' not null,\r
67 visible number(10) default '1' not null,\r
68 timecreated number(10) default '0' not null,\r
69 timemodified number(10) default '0' not null\r
70); \r
71\r
72create index category on prefix_course(category);\r
73\r
74COMMENT on table prefix_course is 'Moodle prefix course table';\r
75\r
76drop sequence p_course_seq;\r
77create sequence p_course_seq;\r
78\r
79create or replace trigger p_course_trig\r
80 before insert on prefix_course\r
81 referencing new as new_row\r
82 for each row\r
83 begin\r
84 select p_course_seq.nextval into :new_row.id from dual;\r
85 end;\r
86.\r
87/\r
88\r
89insert into prefix_course ( category,password,fullname,shortname,summary,modinfo) values ( 1,'password1','fullname1','shortname1','summary1','modinfo1');\r
90insert into prefix_course ( category,password,fullname,shortname,summary,format,modinfo) values ( 2,'password2','fullname2','shortname2','summary2','social','modinfo2');\r
91insert into prefix_course ( category,password,fullname,shortname,summary,format,modinfo) values ( 2,'password2','fullname2','shortname2','summary2','topics','modinfo2');\r
92\r
93select * from prefix_course order by 1,2;\r
94\r
95rem --------------------------------------------------------\r
96\r
97rem\r
98rem Table structure for table course_categories\r
99rem\r
100\r
101drop TABLE prefix_course_categories;\r
102CREATE TABLE prefix_course_categories (\r
103 id number(10) primary key,\r
104 name varchar2(255) default '' not null,\r
105 description varchar2(1024),\r
106 parent number(10) default '0' not null,\r
107 sortorder number(10) default '0' not null,\r
108 coursecount number(10) default '0' not null,\r
109 visible number(1) default '1' not null,\r
110 timemodified number(10) default '0' not null\r
111);\r
112\r
113COMMENT on table prefix_course_categories is 'Course categories';\r
114\r
115drop sequence p_course_categories_seq;\r
116create sequence p_course_categories_seq;\r
117\r
118create or replace trigger p_course_categories_trig\r
119 before insert on prefix_course_categories\r
120 referencing new as new_row\r
121 for each row\r
122 begin\r
123 select p_course_categories_seq.nextval into :new_row.id from dual;\r
124 end;\r
125.\r
126/\r
127\r
128insert into prefix_course_categories (name) values ('name1');\r
129insert into prefix_course_categories (name) values ('name2');\r
130insert into prefix_course_categories (name) values ('name3');\r
131insert into prefix_course_categories (name) values ('name4');\r
132\r
133\r
134select * from prefix_course_categories;\r
135\r
136rem \r
137rem Table structure for table course_display\r
138rem\r
139\r
140drop TABLE prefix_course_display;\r
141CREATE TABLE prefix_course_display (\r
142 id number(10) primary key,\r
143 course number(10) default '0' not null,\r
144 userid number(10) default '0' not null,\r
145 display number(10) default '0' not null\r
146);\r
147\r
148drop sequence p_course_display_seq;\r
149create sequence p_course_display_seq;\r
150\r
151create or replace trigger p_course_display_trig\r
152 before insert on prefix_course_display\r
153 referencing new as new_row\r
154 for each row\r
155 begin\r
156 select p_course_display_seq.nextval into :new_row.id from dual;\r
157 end;\r
158.\r
159/\r
160\r
161create index courseuserid on prefix_course_display(course,userid);\r
162\r
163COMMENT on table prefix_course_display is 'Stores info about how to display the course';\r
164\r
165insert into prefix_course_display (course,userid,display) values (1,1,1);\r
166insert into prefix_course_display (course,userid,display) values (2,2,2);\r
167insert into prefix_course_display (course,userid,display) values (3,3,3);\r
168insert into prefix_course_display (course,userid,display) values (4,4,4);\r
169\r
170select * from prefix_course_display;\r
171\r
172rem --------------------------------------------------------\r
173\r
174rem\r
175rem Table structure for table course_modules\r
176rem\r
177\r
178drop TABLE prefix_course_modules;\r
179CREATE TABLE prefix_course_modules (\r
180 id number(10) primary key,\r
181 course number(10) default '0' not null,\r
182 module number(10) default '0' not null,\r
183 instance number(10) default '0' not null,\r
184 section number(10) default '0' not null,\r
185 added number(10) default '0' not null, \r
186 deleted number(1) default '0' not null,\r
187 score number(4) default '0' not null,\r
401a81dd 188 indent number(5) default '0' not null, \r
96c1e116 189 visible number(1) default '1' not null\r
190);\r
191\r
192COMMENT on table prefix_course_modules is 'prefix_course_modules';\r
193\r
194drop sequence p_course_modules_seq;\r
195create sequence p_course_modules_seq;\r
196\r
197create or replace trigger p_course_modules_trig\r
198 before insert on prefix_course_modules\r
199 referencing new as new_row\r
200 for each row\r
201 begin\r
202 select p_course_modules_seq.nextval into :new_row.id from dual;\r
203 end;\r
204.\r
205/\r
206\r
401a81dd 207insert into prefix_course_modules (course,module,instance,section,added,deleted,score,indent,visible) values (1,1,1,1,1,1,1,1,1); \r
208insert into prefix_course_modules (course,module,instance,section,added,deleted,score,indent,visible) values (2,2,2,2,2,2,2,2,2); \r
209insert into prefix_course_modules (course,module,instance,section,added,deleted,score,indent,visible) values (3,3,3,3,3,3,3,3,3); \r
210insert into prefix_course_modules (course,module,instance,section,added,deleted,score,indent,visible) values (4,4,4,4,4,4,4,4,4); \r
96c1e116 211\r
212select * from prefix_course_modules;\r
213\r
214rem --------------------------------------------------------\r
215rem\r
216rem Table structure for table course_sections\r
217rem\r
218\r
219drop TABLE prefix_course_sections;\r
220CREATE TABLE prefix_course_sections (\r
221 id number(10) primary key,\r
222 course number(10) default '0' not null,\r
223 section number(10) default '0' not null,\r
224 summary varchar2(254) NOT NULL,\r
225 sequence varchar2(255) default '' not null,\r
226 visible number(1) default '1' not null\r
227);\r
228\r
229COMMENT on table prefix_course_sections is 'prefix_course_sections';\r
230\r
231drop sequence p_course_sections_seq;\r
232create sequence p_course_sections_seq;\r
233\r
234create or replace trigger p_course_sections_trig\r
235 before insert on prefix_course_sections\r
236 referencing new as new_row\r
237 for each row\r
238 begin\r
239 select p_course_sections_seq.nextval into :new_row.id from dual;\r
240 end;\r
241.\r
242/\r
243\r
244insert into prefix_course_sections (course,section,summary,sequence) values (1,1,1,1); \r
245insert into prefix_course_sections (course,section,summary,sequence) values (2,2,2,2); \r
246insert into prefix_course_sections (course,section,summary,sequence) values (3,3,3,3); \r
247insert into prefix_course_sections (course,section,summary,sequence) values (4,4,4,4); \r
248\r
249select * from prefix_course_sections;\r
250\r
251rem --------------------------------------------------------\r
252\r
253rem\r
254rem Table structure for table log\r
255rem\r
256\r
257drop TABLE prefix_log;\r
258CREATE TABLE prefix_log (\r
259 id number(10) primary key,\r
260 time number(10) default '0' not null,\r
261 userid number(10) default '0' not null,\r
262 ip varchar2(15) default '' not null,\r
263 course number(10) default '0' not null,\r
264 module varchar2(10) default '' not null,\r
265 action varchar2(15) default '' not null,\r
266 url varchar2(100) default '' not null,\r
267 info varchar2(255) default '' not null\r
268);\r
269\r
270col module format a10\r
271\r
272create index timecoursemoduleaction on prefix_log(time,course,module,action);\r
273\r
274create index coursemoduleaction on prefix_log(course,module,action);\r
275\r
276create index courseuserid0 on prefix_log(course,userid);\r
277\r
278COMMENT on table prefix_log is 'Every action is logged as far as possible.';\r
279\r
280drop sequence p_log_seq;\r
281create sequence p_log_seq;\r
282\r
283create or replace trigger p_log_trig\r
284 before insert on prefix_log\r
285 referencing new as new_row\r
286 for each row\r
287 begin\r
288 select p_log_seq.nextval into :new_row.id from dual;\r
289 end;\r
290.\r
291/\r
292\r
293insert into prefix_log (time,userid,ip,course,module,action,url,info) values (1,1,'ip1',1,'module1','action1','url1','info1'); \r
294insert into prefix_log (time,userid,ip,course,module,action,url,info) values (2,2,'ip2',2,'module2','action2','url2','info2'); \r
295insert into prefix_log (time,userid,ip,course,module,action,url,info) values (3,3,'ip3',3,'module3','action3','url3','info3'); \r
296insert into prefix_log (time,userid,ip,course,module,action,url,info) values (4,4,'ip4',4,'module4','action4','url4','info4'); \r
297\r
298select * from prefix_log;\r
299\r
300rem --------------------------------------------------------\r
301\r
302rem\r
303rem Table structure for table log_display\r
304rem\r
305\r
306drop TABLE prefix_log_display;\r
307CREATE TABLE prefix_log_display (\r
308 module varchar2(20) default '' not null,\r
309 action varchar2(20) default '' not null,\r
310 mtable varchar2(20) default '' not null,\r
311 field varchar2(40) default '' not null\r
312) ;\r
313\r
314COMMENT on table prefix_log_display is 'For a particular module/action, specifies a moodle table/field.';\r
315\r
316rem for testing only\r
317rem insert into prefix_log_display (module,action,mtable,field) values ('module1','action1','mtable1','field1'); \r
318rem insert into prefix_log_display (module,action,mtable,field) values ('module2','action2','mtable2','field2'); \r
319rem insert into prefix_log_display (module,action,mtable,field) values ('module3','action3','mtable3','field3'); \r
320rem insert into prefix_log_display (module,action,mtable,field) values ('module4','action4','mtable4','field4'); \r
321\r
322select * from prefix_log_display;\r
323\r
324rem --------------------------------------------------------\r
325\r
326rem\r
327rem Table structure for table modules\r
328rem\r
329\r
330drop TABLE prefix_modules;\r
331CREATE TABLE prefix_modules (\r
332 id number(10) primary key,\r
333 name varchar2(20) default '' not null,\r
334 version number(10) default '0' not null,\r
335 cron number(10) default '0' not null,\r
336 lastcron number(10) default '0' not null,\r
337 search varchar2(255) default '' not null,\r
338 visible number(1) default '1' not null\r
339);\r
340\r
341drop sequence p_modules_seq;\r
342create sequence p_modules_seq;\r
343\r
344create or replace trigger p_modules_trig\r
345 before insert on prefix_modules\r
346 referencing new as new_row\r
347 for each row\r
348 begin\r
349 select p_modules_seq.nextval into :new_row.id from dual;\r
350 end;\r
351.\r
352/\r
353\r
354insert into prefix_modules (name,version,cron,lastcron,search) values ('name1',1,1,1,'search1'); \r
355insert into prefix_modules (name,version,cron,lastcron,search) values ('name2',2,2,2,'search2'); \r
356insert into prefix_modules (name,version,cron,lastcron,search) values ('name3',3,3,3,'search3'); \r
357insert into prefix_modules (name,version,cron,lastcron,search) values ('name4',4,4,4,'search4'); \r
358\r
359select * from prefix_modules;\r
360\r
361rem --------------------------------------------------------\r
362\r
363drop TABLE prefix_scale;\r
364CREATE TABLE prefix_scale (\r
365 id number(10) primary key,\r
366 courseid number(10) default '0' not null,\r
367 userid number(10) default '0' not null,\r
368 name varchar2(255) default '' not null,\r
369 scale varchar2(1024),\r
370 description varchar2(1024),\r
371 timemodified number(10) default '0' not null\r
372);\r
373\r
374COMMENT on table prefix_scale is 'Defines grading scales';\r
375\r
376drop sequence p_scale_seq;\r
377create sequence p_scale_seq;\r
378\r
379create or replace trigger p_scale_trig\r
380 before insert on prefix_scale\r
381 referencing new as new_row\r
382 for each row\r
383 begin\r
384 select p_scale_seq.nextval into :new_row.id from dual;\r
385 end;\r
386.\r
387/\r
388\r
389insert into prefix_scale( courseid, userid, name, scale, description, timemodified) values(1,1,'1','1','1',1);\r
390insert into prefix_scale( courseid, userid, name, scale, description, timemodified) values(2,2,'2','2','2',2);\r
391insert into prefix_scale( courseid, userid, name, scale, description, timemodified) values(3,3,'3','3','3',3);\r
392insert into prefix_scale( courseid, userid, name, scale, description, timemodified) values(4,4,'4','4','4',4);\r
393\r
394select * from prefix_scale order by 1,2;\r
395\r
396rem --------------------------------------------------------\r
397\r
398rem\r
399rem Table structure for table user\r
400rem\r
401\r
402drop TABLE prefix_user;\r
403CREATE TABLE prefix_user (\r
404 id number(10) primary key,\r
405 confirmed number(1) default '0' not null,\r
406 deleted number(1) default '0' not null,\r
407 username varchar2(100) default '' not null \r
408 constraint unq_username unique,\r
409 password varchar2(32) default '' not null,\r
410 idnumber varchar2(12) default NULL,\r
411 firstname varchar2(20) default '' not null,\r
412 lastname varchar2(20) default '' not null,\r
413 email varchar2(100) default '' not null,\r
414 icq varchar2(15) default NULL,\r
415 phone1 varchar2(20) default NULL,\r
416 phone2 varchar2(20) default NULL,\r
417 institution varchar2(40) default NULL,\r
418 department varchar2(30) default NULL,\r
419 address varchar2(70) default NULL,\r
420 city varchar2(20) default NULL,\r
421 country varchar2(2) default NULL,\r
422 lang varchar2(5) default 'en',\r
423 timezone float default '99' not null,\r
424 firstaccess number(10) default '0' not null,\r
425 lastaccess number(10) default '0' not null,\r
426 lastlogin number(10) default '0' not null,\r
427 currentlogin number(10) default '0' not null,\r
428 lastIP varchar2(15) default NULL,\r
429 secret varchar2(15) default NULL,\r
430 picture number(1) default NULL,\r
431 url varchar2(255) default NULL,\r
432 description varchar2(255),\r
433 mailformat number(1) default '1' not null,\r
434 maildisplay number(2) default '2' not null,\r
435 htmleditor number(1) default '1' not null,\r
436 autosubscribe number(1) default '1' not null,\r
437 timemodified number(10) default '0' not null\r
438) ;\r
439\r
440COMMENT on table prefix_user is 'One record for each person';\r
441\r
442drop sequence p_user_seq;\r
443create sequence p_user_seq;\r
444\r
445create or replace trigger p_user_trig\r
446 before insert on prefix_user\r
447 referencing new as new_row\r
448 for each row\r
449 begin\r
450 select p_user_seq.nextval into :new_row.id from dual;\r
451 end;\r
452.\r
453/\r
454insert into prefix_user ( confirmed, deleted, username, password, idnumber, firstname, lastname, email, icq, phone1, phone2, institution, department, address, city, country, lang, timezone, firstaccess, lastaccess, lastlogin, currentlogin, lastIP, secret, picture, url, description, mailformat, maildisplay, htmleditor, timemodified ) values ( 1, 1, 'username1', 'password1', 'idnumber1', 'firstname1', 'lastname1', 'email1', 'icq1', 'phone11', 'phone21', 'institution1', 'department1', 'address1', 'city1', 'c1', 'lang1', 1, 1, 1, 1, 1, 'lastIP1', 'secret1', 1, 'url1', 'description1', 1, 1, 1, 1);\r
455insert into prefix_user ( confirmed, deleted, username, password, idnumber, firstname, lastname, email, icq, phone1, phone2, institution, department, address, city, country, lang, timezone, firstaccess, lastaccess, lastlogin, currentlogin, lastIP, secret, picture, url, description, mailformat, maildisplay, htmleditor, timemodified ) \r
456values ( 2, 2, 'username2', 'password2', 'idnumber2', 'firstname2', 'lastname2', 'email2', 'icq2', 'phone12', 'phone22', 'institution2', 'department2', 'address2', 'city2', 'c2', 'lang2', 2, 2, 2, 2, 2, 'lastIP2', 'secret2', 2, 'url2', 'description2', 2, 2, 2, 2);\r
457insert into prefix_user ( confirmed, deleted, username, password, idnumber, firstname, lastname, email, icq, phone1, phone2, institution, department, address, city, country, lang, timezone, firstaccess, lastaccess, lastlogin, currentlogin, lastIP, secret, picture, url, description, mailformat, maildisplay, htmleditor, timemodified ) values ( 3, 3, 'username3', 'password3', 'idnumber3', 'firstname3', 'lastname3', 'email3', 'icq3', 'phone13', 'phone23', 'institution3', 'department3', 'address3', 'city3', 'c3', 'lang3', 3, 3, 3, 3, 3, 'lastIP3', 'secret3', 3, 'url3', 'description3', 3, 3, 3, 3);\r
458\r
459rem test unique constraint on username: this statement should fail\r
460insert into prefix_user ( confirmed, deleted, username, password, idnumber, firstname, lastname, email, icq, phone1, phone2, institution, department, address, city, country, lang, timezone, firstaccess, lastaccess, lastlogin, currentlogin, lastIP, secret, picture, url, description, mailformat, maildisplay, htmleditor, timemodified ) values ( 4, 4, 'username1', 'password4', 'idnumber4', 'firstname4', 'lastname4', 'email4', 'icq4', 'phone14', 'phone24', 'institution4', 'department4', 'address4', 'city4', 'c4', 'lang4', 4, 4, 4, 4, 4, 'lastIP4', 'secret4', 4, 'url4', 'description4', 4, 4, 4, 4);\r
461\r
462select * from prefix_user;\r
463\r
464rem --------------------------------------------------------\r
465\r
466rem\r
467rem Table structure for table user_admins\r
468rem\r
469\r
470drop TABLE prefix_user_admins;\r
471CREATE TABLE prefix_user_admins (\r
472 id number(10) primary key,\r
473 userid number(10) default '0' not null\r
474);\r
475\r
476COMMENT on table prefix_user_admins is 'One record per administrator user';\r
477\r
478drop sequence p_user_admins_seq;\r
479create sequence p_user_admins_seq;\r
480\r
481create or replace trigger p_user_admins_trig\r
482 before insert on prefix_user_admins\r
483 referencing new as new_row\r
484 for each row\r
485 begin\r
486 select p_user_admins_seq.nextval into :new_row.id from dual;\r
487 end;\r
488.\r
489/\r
490insert into prefix_user_admins (userid) values (1); \r
491insert into prefix_user_admins (userid) values (2); \r
492insert into prefix_user_admins (userid) values (3); \r
493insert into prefix_user_admins (userid) values (4); \r
494\r
495select * from prefix_user_admins;\r
496\r
497rem --------------------------------------------------------\r
498\r
499rem\r
500rem Table structure for table user_students\r
501rem\r
502\r
503drop TABLE prefix_user_students;\r
504CREATE TABLE prefix_user_students (\r
505 id number(10) primary key,\r
506 userid number(10) default '0' not null,\r
507 course number(10) default '0' not null,\r
508 timestart number(10) default '0' not null,\r
509 timeend number(10) default '0' not null,\r
510 time number(10) default '0' not null\r
511);\r
512\r
513create index courseuserid1 on prefix_user_students(course,userid);\r
514\r
515drop sequence p_user_students_seq;\r
516create sequence p_user_students_seq;\r
517\r
518create or replace trigger p_user_students_trig\r
519 before insert on prefix_user_students\r
520 referencing new as new_row\r
521 for each row\r
522 begin\r
523 select p_user_students_seq.nextval into :new_row.id from dual;\r
524 end;\r
525.\r
526/\r
527insert into prefix_user_students (userid,course,timestart,timeend,time) values (1,1,1,1,1); \r
528insert into prefix_user_students (userid,course,timestart,timeend,time) values (2,2,2,2,2); \r
529insert into prefix_user_students (userid,course,timestart,timeend,time) values (3,3,3,3,3); \r
530insert into prefix_user_students (userid,course,timestart,timeend,time) values (4,4,4,4,4); \r
531\r
532select * from prefix_user_students;\r
533\r
534\r
535rem --------------------------------------------------------\r
536\r
537rem\r
538rem Table structure for table user_teachers\r
539rem\r
540\r
541drop TABLE prefix_user_teachers;\r
542CREATE TABLE prefix_user_teachers (\r
543 id number(10) primary key,\r
544 userid number(10) default '0' not null,\r
545 course number(10) default '0' not null,\r
546 authority number(10) default '3' not null,\r
547 role varchar2(40) default '' not null,\r
548 editall number(1) default '1' not null,\r
549 timemodified number(10) default '0' not null\r
550);\r
551\r
552create index courseuserid2 on prefix_user_teachers(course,userid);\r
553\r
554COMMENT on table prefix_user_teachers is 'One record per teacher per course';\r
555\r
556drop sequence p_user_teachers_seq;\r
557create sequence p_user_teachers_seq;\r
558\r
559create or replace trigger p_user_teachers_trig\r
560 before insert on prefix_user_teachers\r
561 referencing new as new_row\r
562 for each row\r
563 begin\r
564 select p_user_teachers_seq.nextval into :new_row.id from dual;\r
565 end;\r
566.\r
567/\r
568insert into prefix_user_teachers (userid,course,authority,role) values (1,1,1,'role1'); \r
569insert into prefix_user_teachers (userid,course,authority,role) values (2,2,2,'role2'); \r
570insert into prefix_user_teachers (userid,course,authority,role) values (3,3,3,'role3'); \r
571insert into prefix_user_teachers (userid,course,authority,role) values (3,3,3,'role3'); \r
572\r
573select * from prefix_user_teachers;\r
574\r
575rem\r
576rem Table structure for table user_coursecreators\r
577rem\r
578\r
579drop TABLE prefix_user_coursecreators;\r
580CREATE TABLE prefix_user_coursecreators (\r
581 id number(10) primary key,\r
582 userid number(10) default '0' not null\r
583);\r
584\r
585COMMENT on table prefix_user_coursecreators is 'One record per course creator';\r
586drop sequence p_user_coursecreators_seq;\r
587create sequence p_user_coursecreators_seq;\r
588\r
589create or replace trigger p_user_coursecreators_trig\r
590 before insert on prefix_user_coursecreators\r
591 referencing new as new_row\r
592 for each row\r
593 begin\r
594 select p_user_coursecreators_seq.nextval into :new_row.id from dual;\r
595 end;\r
596.\r
597/\r
598insert into prefix_user_coursecreators (userid) values (1);\r
599insert into prefix_user_coursecreators (userid) values (2);\r
600insert into prefix_user_coursecreators (userid) values (3);\r
601insert into prefix_user_coursecreators (userid) values (4);\r
602\r
603select * from prefix_user_coursecreators;\r
604\r
605rem --------------------------------------------------------\r
606\r
607INSERT INTO prefix_log_display VALUES ('user', 'view', 'user', 'firstname'||' '||'lastname');\r
608INSERT INTO prefix_log_display VALUES ('course', 'view', 'course', 'fullname');\r
609INSERT INTO prefix_log_display VALUES ('course', 'update', 'course', 'fullname');\r
610INSERT INTO prefix_log_display VALUES ('course', 'enrol', 'course', 'fullname');\r
611INSERT INTO prefix_log_display VALUES ('course', 'update', 'course', 'fullname');\r
612\r
613select * from prefix_log_display where module in ('user','course') order by 1,2;\r