Permalink
Browse files

Oracle tables, etc converted from mysql, plus test transactions.

  • Loading branch information...
1 parent 1930ab3 commit 96c1e116e6a340c3378f6c851cfa6b481016c073 les_kopari committed Sep 13, 2003
View

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1,98 @@
+rem
+rem Table structure for table assignment
+rem
+
+drop TABLE prefix_assignment;
+CREATE TABLE prefix_assignment (
+ id number(10) primary key,
+ course number(10) default '0' not null,
+ name varchar(255) default '' not null,
+ description varchar2(255) NOT NULL,
+ format number(2) default '0' not null,
+ resubmit number(2) default '0' not null,
+ type number(10) default '1' not null,
+ maxbytes number(10) default '100000' not null,
+ timedue number(10) default '0' not null,
+ grade number(10) default '0' not null,
+ timemodified number(10) default '0' not null
+);
+
+COMMENT on table prefix_assignment is 'Defines assignments';
+
+drop sequence p_assignment_seq;
+create sequence p_assignment_seq;
+
+create or replace trigger p_assignment_trig
+ before insert on prefix_assignment
+ referencing new as new_row
+ for each row
+ begin
+ select p_assignment_seq.nextval into :new_row.id from dual;
+ end;
+.
+/
+
+insert into prefix_assignment (course,name,description,format,resubmit,type,maxbytes,timedue,grade,timemodified) values (1,'name1','description1','1','1','1','111111','1','1','1');
+insert into prefix_assignment (course,name,description,format,resubmit,type,maxbytes,timedue,grade,timemodified) values (2,'name2','description2','2','2','2','222222','2','2','2');
+insert into prefix_assignment (course,name,description,format,resubmit,type,maxbytes,timedue,grade,timemodified) values (3,'name3','description3','3','3','3','333333','3','3','3');
+insert into prefix_assignment (course,name,description,format,resubmit,type,maxbytes,timedue,grade,timemodified) values (4,'name4','description4','4','4','4','444444','4','4','4');
+
+col format format 99
+select * from prefix_assignment order by 1,2;
+
+rem --------------------------------------------------------
+
+rem
+rem Table structure for table assignment_submissions
+rem
+
+drop TABLE prefix_assignment_submissions;
+CREATE TABLE prefix_assignment_submissions (
+ id number(10) primary key ,
+ assignment number(10) default '0' not null,
+ userid number(10) default '0' not null,
+ timecreated number(10) default '0' not null,
+ timemodified number(10) default '0' not null,
+ numfiles number(10) default '0' not null,
+ grade number(11) default '0' not null,
+ commentt varchar2(255) not null,
+ teacher number(10) default '0' not null,
+ timemarked number(10) default '0' not null,
+ mailed number(1) default '0' not null
+);
+
+
+COMMENT on table prefix_assignment_submissions is 'Info about submitted assignments';
+
+drop sequence p_assignment_sub_seq;
+create sequence p_assignment_sub_seq;
+
+create or replace trigger p_assignment_sub_trig
+ before insert on prefix_assignment_submissions
+ referencing new as new_row
+ for each row
+ begin
+ select p_assignment_sub_seq.nextval into :new_row.id from dual;
+ end;
+.
+/
+
+insert into prefix_assignment_submissions(
+ assignment,userid,timecreated,timemodified,numfiles,grade,commentt,teacher,timemarked,mailed) values ('1','1','1','1','1','1','comment1','1','1','1');
+insert into prefix_assignment_submissions(assignment,userid,timecreated,timemodified,numfiles,grade,commentt,teacher,timemarked,mailed) values ('2','2','2','2','2','2','comment2','2','2','2');
+insert into prefix_assignment_submissions(assignment,userid,timecreated,timemodified,numfiles,grade,commentt,teacher,timemarked,mailed) values ('3','3','3','3','3','3','comment3','3','3','3');
+insert into prefix_assignment_submissions(assignment,userid,timecreated,timemodified,numfiles,grade,commentt,teacher,timemarked,mailed) values ('4','4','4','4','4','4','comment4','4','4','4');
+
+col teacher format 99
+select * from prefix_assignment_submissions order by 1,2;
+
+rem --------------------------------------------------------
+
+delete from prefix_log_display where module='assignment';
+INSERT INTO prefix_log_display VALUES ('assignment', 'view', 'assignment', 'name');
+INSERT INTO prefix_log_display VALUES ('assignment', 'add', 'assignment', 'name');
+INSERT INTO prefix_log_display VALUES ('assignment', 'update', 'assignment', 'name');
+INSERT INTO prefix_log_display VALUES ('assignment', 'view submissions', 'assignment', 'name');
+INSERT INTO prefix_log_display VALUES ('assignment', 'upload', 'assignment', 'name');
+
+select * from prefix_log_display where module='assignment' order by 1,2;
View
@@ -0,0 +1,131 @@
+rem
+rem Table structure for table chat
+rem
+
+drop TABLE prefix_chat;
+CREATE TABLE prefix_chat (
+ id number(10) primary key,
+ course number(10) default '0' not null,
+ name varchar2(255) default '' not null,
+ intro varchar2(1024) NOT NULL,
+ keepdays number(11) default '0' not null,
+ studentlogs number(4) default '0' not null,
+ chattime number(10) default '0' not null,
+ schedule number(4) default '0' not null,
+ timemodified number(10) default '0' not null
+);
+
+
+COMMENT on table prefix_chat is 'Each of these is a chat room';
+
+drop sequence p_chat_seq;
+create sequence p_chat_seq;
+
+create or replace trigger p_chat_trig
+ before insert on prefix_chat
+ referencing new as new_row
+ for each row
+ begin
+ select p_chat_seq.nextval into :new_row.id from dual;
+ end;
+.
+/
+
+insert into prefix_chat(course,name,intro,keepdays,studentlogs,chattime,schedule,timemodified) values(1,'name 1','intro 1',1,1,1,1,1);
+insert into prefix_chat(course,name,intro,keepdays,studentlogs,chattime,schedule,timemodified) values(2,'name 2','intro 2',2,2,2,2,2);
+insert into prefix_chat(course,name,intro,keepdays,studentlogs,chattime,schedule,timemodified) values(3,'name 3','intro 3',3,3,3,3,3);
+insert into prefix_chat(course,name,intro,keepdays,studentlogs,chattime,schedule,timemodified) values(4,'name 4','intro 4',4,4,4,4,4);
+
+select * from prefix_chat;
+
+rem --------------------------------------------------------
+rem
+rem Table structure for table chat_messages
+rem
+
+drop TABLE prefix_chat_messages;
+CREATE TABLE prefix_chat_messages (
+ id number(10) primary key,
+ chatid number(10) default '0' not null,
+ userid number(10) default '0' not null,
+ system number(1) default '0' not null,
+ message varchar2(1024) NOT NULL,
+ timestamp number(10) default '0' not null
+);
+
+COMMENT on table prefix_chat_messages is 'Stores all the actual chat messages';
+
+create index timemodifiedchat on prefix_chat_messages(timestamp,chatid);
+
+drop sequence p_chat_messages_seq;
+create sequence p_chat_messages_seq;
+
+create or replace trigger p_chat_messages_trig
+ before insert on prefix_chat_messages
+ referencing new as new_row
+ for each row
+ begin
+ select p_chat_messages_seq.nextval into :new_row.id from dual;
+ end;
+.
+/
+
+insert into prefix_chat_messages (chatid,userid,system,message,timestamp) values(1,1,1,'message1',1);
+insert into prefix_chat_messages (chatid,userid,system,message,timestamp) values(2,2,2,'message2',2);
+insert into prefix_chat_messages (chatid,userid,system,message,timestamp) values(3,3,3,'message3',3);
+insert into prefix_chat_messages (chatid,userid,system,message,timestamp) values(4,4,4,'message4',4);
+
+select * from prefix_chat_messages;
+
+rem --------------------------------------------------------
+
+rem
+rem Table structure for table chat_users
+rem
+
+drop TABLE prefix_chat_users;
+CREATE TABLE prefix_chat_users (
+ id number(10) primary key,
+ chatid number(11) default '0' not null,
+ userid number(11) default '0' not null,
+ version varchar2(16) default '' not null,
+ ip varchar2(15) default '' not null,
+ firstping number(10) default '0' not null,
+ lastping number(10) default '0' not null,
+ lastmessageping number(10) default '0' not null,
+ sid varchar2(32) default '' not null
+);
+
+create index userid on prefix_chat_users(userid);
+create index lastping on prefix_chat_users(lastping);
+
+drop sequence p_chat_users_seq;
+create sequence p_chat_users_seq;
+
+create or replace trigger p_chat_users_trig
+ before insert on prefix_chat_users
+ referencing new as new_row
+ for each row
+ begin
+ select p_chat_users_seq.nextval into :new_row.id from dual;
+ end;
+.
+/
+
+COMMENT on table prefix_chat_users is 'Keeps track of which users are in which chat rooms';
+
+insert into prefix_chat_users (chatid,userid,version,ip,firstping,lastping,lastmessageping,sid) values(1,1,'version1','ip1',1,1,1,'sid1');
+insert into prefix_chat_users (chatid,userid,version,ip,firstping,lastping,lastmessageping,sid) values(2,2,'version2','ip2',2,2,2,'sid2');
+insert into prefix_chat_users (chatid,userid,version,ip,firstping,lastping,lastmessageping,sid) values(3,3,'version3','ip3',3,3,3,'sid3');
+insert into prefix_chat_users (chatid,userid,version,ip,firstping,lastping,lastmessageping,sid) values(4,4,'version4','ip4',4,4,4,'sid4');
+
+select * from prefix_chat_users;
+
+delete from prefix_log_display where module='chat';
+
+INSERT INTO prefix_log_display VALUES ('chat', 'view', 'chat', 'name');
+INSERT INTO prefix_log_display VALUES ('chat', 'add', 'chat', 'name');
+INSERT INTO prefix_log_display VALUES ('chat', 'update', 'chat', 'name');
+INSERT INTO prefix_log_display VALUES ('chat', 'report', 'chat', 'name');
+
+select * from prefix_log_display where module='chat' order by 1,2,3,4;
View
@@ -0,0 +1,93 @@
+rem
+rem Table structure for table choice
+rem
+
+drop TABLE prefix_choice;
+CREATE TABLE prefix_choice (
+ id number(10) primary key,
+ course number(10) default '0' not null,
+ name varchar2(255) default '' not null,
+ text varchar2(1024) NOT NULL,
+ format number(2) default '0' not null,
+ answer1 varchar2(255) default 'Yes' not null,
+ answer2 varchar2(255) default 'No' not null,
+ answer3 varchar2(255) default NULL,
+ answer4 varchar2(255) default NULL,
+ answer5 varchar2(255) default NULL,
+ answer6 varchar2(255) default NULL,
+ publish number(2) default '0' not null,
+ timemodified number(10) default '0' not null
+);
+
+COMMENT on table prefix_choice is 'Available choices are stored here.';
+
+drop sequence p_choice_seq;
+create sequence p_choice_seq;
+
+create or replace trigger p_choice_trig
+ before insert on prefix_choice
+ referencing new as new_row
+ for each row
+ begin
+ select p_choice_seq.nextval into :new_row.id from dual;
+ end;
+.
+/
+
+insert into prefix_choice(course,name,text,format,answer1,answer2,answer3,answer4,answer5,answer6,publish,timemodified) values(1,'name1','text1',1,'1','1','1','1','1','1',1,1);
+insert into prefix_choice(course,name,text,format,answer1,answer2,answer3,answer4,answer5,answer6,publish,timemodified) values(2,'name2','text2',2,'2','2','2','2','2','2',2,2);
+insert into prefix_choice(course,name,text,format,answer1,answer2,answer3,answer4,answer5,answer6,publish,timemodified) values(3,'name3','text3',3,'3','3','3','3','3','3',3,3);
+insert into prefix_choice(course,name,text,format,answer1,answer2,answer3,answer4,answer5,answer6,publish,timemodified) values(4,'name4','text4',4,'4','4','4','4','4','4',4,4);
+
+select * from prefix_choice order by 1,2;
+
+rem --------------------------------------------------------
+
+rem
+rem Table structure for table choice_answers
+rem
+
+drop TABLE prefix_choice_answers;
+CREATE TABLE prefix_choice_answers (
+ id number(10) primary key,
+ choice number(10) default '0' not null,
+ userid number(10) default '0' not null,
+ answer number(4) default '0' not null,
+ timemodified number(10) default '0' not null
+);
+
+comment on table prefix_choice_answers is 'Answers for each choice';
+
+drop sequence p_choice_answers_seq;
+create sequence p_choice_answers_seq;
+
+create or replace trigger p_choice_answers_trig
+ before insert on prefix_choice_answers
+ referencing new as new_row
+ for each row
+ begin
+ select p_choice_answers_seq.nextval into :new_row.id from dual;
+ end;
+.
+/
+
+insert into prefix_choice_answers (choice,userid,answer,timemodified) values(1,1,1,1);
+insert into prefix_choice_answers (choice,userid,answer,timemodified) values(2,2,2,2);
+insert into prefix_choice_answers (choice,userid,answer,timemodified) values(3,3,3,3);
+insert into prefix_choice_answers (choice,userid,answer,timemodified) values(4,4,4,4);
+
+select * from prefix_choice_answers order by 1,2;
+
+rem
+rem Dumping data for table log_display
+rem
+
+delete from prefix_log_display where module = 'choice';
+INSERT INTO prefix_log_display VALUES ('choice', 'view', 'choice', 'name');
+INSERT INTO prefix_log_display VALUES ('choice', 'update', 'choice', 'name');
+INSERT INTO prefix_log_display VALUES ('choice', 'add', 'choice', 'name');
+INSERT INTO prefix_log_display VALUES ('choice', 'report', 'choice', 'name');
+
+
+
+
Oops, something went wrong.

0 comments on commit 96c1e11

Please sign in to comment.