moodle/mod/glossary/db/oci8po.sql
2003-09-16 17:23:27 +00:00

98 lines
3.8 KiB
MySQL
Executable File

rem This file contains a complete database schema for all the
rem tables used by this module, written in SQL
rem It may also contain INSERT statements for particular data
rem that may be used, especially new entries in the table log_display
rem
rem Table structure for table glossary
rem
drop TABLE prefix_glossary;
CREATE TABLE prefix_glossary (
id number(10) primary key,
course number(10) default '0' not null,
name varchar2(255) default '' not null,
studentcanpost number(2) default '0' not null,
allowduplicatedentries number(2) default '0' not null,
displayformat number(2) default '0' not null,
mainglossary number(2) default '0' not null,
timecreated number(10) default '0' not null,
timemodified number(10) default '0' not null
);
COMMENT on table prefix_glossary is 'all glossaries';
drop sequence p_glossary_seq;
create sequence p_glossary_seq;
create or replace trigger p_glossary_trig
before insert on prefix_glossary
referencing new as new_row
for each row
begin
select p_glossary_seq.nextval into :new_row.id from dual;
end;
.
/
insert into prefix_glossary(course,name,studentcanpost,allowduplicatedentries,displayformat,mainglossary,timecreated,timemodified) values(1,'1',1,1,1,1,1,1);
insert into prefix_glossary(course,name,studentcanpost,allowduplicatedentries,displayformat,mainglossary,timecreated,timemodified) values(2,'2',2,2,2,2,2,2);
insert into prefix_glossary(course,name,studentcanpost,allowduplicatedentries,displayformat,mainglossary,timecreated,timemodified) values(3,'3',3,3,3,3,3,3);
insert into prefix_glossary(course,name,studentcanpost,allowduplicatedentries,displayformat,mainglossary,timecreated,timemodified) values(4,'4',4,4,4,4,4,4);
select * from prefix_glossary order by 1,2;
rem
rem Table structure for table glossary_entries
rem
drop TABLE prefix_glossary_entries;
CREATE TABLE prefix_glossary_entries (
id number(10) primary key,
glossaryid number(10) default '0' not null,
userid number(10) default '0' not null,
concept varchar2(255) default '' not null,
definition varchar2(1024) NOT NULL,
format number(2) default '0' not null,
timecreated number(10) default '0' not null,
timemodified number(10) default '0' not null,
teacherentry number(2) default '0' not null
);
COMMENT on table prefix_glossary_entries is 'all glossary entries';
drop sequence p_glossary_entries_seq;
create sequence p_glossary_entries_seq;
create or replace trigger p_glossary_entries_trig
before insert on prefix_glossary_entries
referencing new as new_row
for each row
begin
select p_glossary_entries_seq.nextval into :new_row.id from dual;
end;
.
/
insert into prefix_glossary_entries(glossaryid,userid,concept,definition,format,timecreated,timemodified,teacherentry) values(1,1,'1','1',1,1,1,1);
insert into prefix_glossary_entries(glossaryid,userid,concept,definition,format,timecreated,timemodified,teacherentry) values(2,2,'2','2',2,2,2,2);
insert into prefix_glossary_entries(glossaryid,userid,concept,definition,format,timecreated,timemodified,teacherentry) values(3,3,'3','3',3,3,3,3);
insert into prefix_glossary_entries(glossaryid,userid,concept,definition,format,timecreated,timemodified,teacherentry) values(4,4,'4','4',4,4,4,4);
col format format 99
select * from prefix_glossary_entries order by 1,2;
rem
rem Dumping data for table log_display
rem
INSERT INTO prefix_log_display VALUES ('glossary', 'add', 'glossary', 'name');
INSERT INTO prefix_log_display VALUES ('glossary', 'update', 'glossary', 'name');
INSERT INTO prefix_log_display VALUES ('glossary', 'view', 'glossary', 'name');
INSERT INTO prefix_log_display VALUES ('glossary', 'view all', 'glossary', 'name');
INSERT INTO prefix_log_display VALUES ('glossary', 'add entry', 'glossary', 'name');
INSERT INTO prefix_log_display VALUES ('glossary', 'update entry', 'glossary', 'name');