From 1e57486f1140ba96ca1bccd8d9c11d175503607a Mon Sep 17 00:00:00 2001 From: paca70 Date: Tue, 2 Dec 2003 17:00:39 +0000 Subject: [PATCH] Initial version for postgresql. --- mod/dialogue/db/postgres7.php | 13 ++++ mod/dialogue/db/postgres7.sql | 75 ++++++++++++++++++++++ mod/exercise/db/postgres7.php | 13 ++++ mod/exercise/db/postgres7.sql | 113 ++++++++++++++++++++++++++++++++++ 4 files changed, 214 insertions(+) create mode 100644 mod/dialogue/db/postgres7.php create mode 100644 mod/dialogue/db/postgres7.sql create mode 100644 mod/exercise/db/postgres7.php create mode 100644 mod/exercise/db/postgres7.sql diff --git a/mod/dialogue/db/postgres7.php b/mod/dialogue/db/postgres7.php new file mode 100644 index 0000000000..51920dd117 --- /dev/null +++ b/mod/dialogue/db/postgres7.php @@ -0,0 +1,13 @@ + diff --git a/mod/dialogue/db/postgres7.sql b/mod/dialogue/db/postgres7.sql new file mode 100644 index 0000000000..494bb89ae5 --- /dev/null +++ b/mod/dialogue/db/postgres7.sql @@ -0,0 +1,75 @@ +# +# A note on the naming convention used in this module: +# +# As a Dialogue instance can have a number of Dialogues +# the fact that a course can have more than one Dialogue +# instance complicates the nomenclature within the code. +# We want to easily refer to dialogues within dialogues. +# +# For this reason a Dialogue instance is said to have +# a set of Conversations (not dialogues). So the code +# (and the table structure here) uses conversations +# within dialogues. The term "conversation" is just an +# INTERNAL name and it is NOT used in the user +# interface. There is NO need to distinguish between +# dialogue instances and a set of dialogues within one +# dialogue instance from the point of view of teachers +# or students point of view. + +# +# Table structure for table dialogue +# + +CREATE TABLE prefix_dialogue ( + id SERIAL8 PRIMARY KEY, + course INT8 NOT NULL default '0', + deleteafter INT8 NOT NULL default '14', + dialoguetype INT NOT NULL default '0', + multipleconversations INT NOT NULL default '0', + maildefault INT NOT NULL default '0', + timemodified INT8 NOT NULL default '0', + name varchar(255) default NULL, + intro text +) ; +# -------------------------------------------------------- + +# +# Table structure for table dialogue_conversations (Virtual Conversations) +# + +CREATE TABLE prefix_dialogue_conversations ( + id SERIAL8 PRIMARY KEY, + dialogueid INT8 NOT NULL default '0', + userid INT8 NOT NULL default '0', + recipientid INT8 NOT NULL default '0', + lastid INT8 NOT NULL default '0', + timemodified INT8 NOT NULL default '0', + closed INT NOT NULL default '0', + seenon INT8 NOT NULL default '0', + ctype INT NOT NULL default '0', + format INT2 NOT NULL default '0', + subject varchar(100) not null default '' +) ; +CREATE INDEX prefix_dialogue_conversations_timemodified_idx ON prefix_dialogue_conversations (timemodified) ; +CREATE INDEX prefix_dialogue_conversations_dialogueid_idx ON prefix_dialogue_conversations (dialogueid) ; + +# +# Table structure for table dialogue_entries +# + +CREATE TABLE prefix_dialogue_entries ( + id SERIAL8 PRIMARY KEY, + dialogueid INT8 NOT NULL default '0', + conversationid INT8 NOT NULL default '0', + userid INT8 NOT NULL default '0', + timecreated INT8 NOT NULL default '0', + mailed INT2 NOT NULL default '0', + text text NOT NULL +) ; +CREATE INDEX prefix_dialogue_entries_conversationid_idx ON prefix_dialogue_entries (conversationid) ; + +# +# Data for the table log_display +# + +INSERT INTO prefix_log_display VALUES ('dialogue', 'view', 'dialogue', 'name'); diff --git a/mod/exercise/db/postgres7.php b/mod/exercise/db/postgres7.php new file mode 100644 index 0000000000..2a788980d1 --- /dev/null +++ b/mod/exercise/db/postgres7.php @@ -0,0 +1,13 @@ + diff --git a/mod/exercise/db/postgres7.sql b/mod/exercise/db/postgres7.sql new file mode 100644 index 0000000000..e5b443f113 --- /dev/null +++ b/mod/exercise/db/postgres7.sql @@ -0,0 +1,113 @@ +# +# Table structure for table exercise +# + +CREATE TABLE prefix_exercise ( + id SERIAL8 PRIMARY KEY, + course INT8 NOT NULL default '0', + name varchar(255) NOT NULL default '', + nelements INT NOT NULL default '1', + phase INT NOT NULL default '0', + gradingstrategy INT NOT NULL default '1', + usemaximum INT NOT NULL default '0', + anonymous INT NOT NULL default '0', + maxbytes INT8 NOT NULL default '100000', + deadline INT8 NOT NULL default '0', + grade INT NOT NULL default '0', + timemodified INT8 NOT NULL default '0', + teacherweight INT NOT NULL default '5', + gradingweight INT NOT NULL default '5', + showleaguetable INT NOT NULL default '0' +); +# -------------------------------------------------------- + +# +# Table structure for table exercise_submissions +# + +CREATE TABLE prefix_exercise_submissions ( + id SERIAL8 PRIMARY KEY, + exerciseid INT8 NOT NULL default '0', + userid INT8 NOT NULL default '0', + title varchar(100) NOT NULL default '', + timecreated INT8 NOT NULL default '0', + resubmit INT NOT NULL default '0', + mailed INT NOT NULL default '0', + isexercise INT NOT NULL default '0' +); +CREATE INDEX prefix_exercise_submissions_userid_idx ON prefix_exercise_submissions (userid); +# -------------------------------------------------------- + +# +# Table structure for table exercise_assessments +# + +CREATE TABLE prefix_exercise_assessments ( + id SERIAL8 PRIMARY KEY, + exerciseid INT8 NOT NULL default '0', + submissionid INT8 NOT NULL default '0', + userid INT8 NOT NULL default '0', + timecreated INT8 NOT NULL default '0', + timegraded INT8 NOT NULL default '0', + grade float NOT NULL default '0', + gradinggrade INT NOT NULL default '0', + mailed INT2 NOT NULL default '0', + generalcomment text NOT NULL, + teachercomment text NOT NULL + ); +# -------------------------------------------------------- +CREATE INDEX prefix_exercise_assessments_submissionid_idx ON prefix_exercise_assessments (submissionid); +CREATE INDEX prefix_exercise_assessments_userid_idx ON prefix_exercise_assessments (userid); + +# Table structure for table exercise_elements +# + +CREATE TABLE prefix_exercise_elements ( + id SERIAL8 PRIMARY KEY, + exerciseid INT8 NOT NULL default '0', + elementno INT NOT NULL default '0', + description text NOT NULL, + scale INT NOT NULL default '0', + maxscore INT NOT NULL default '1', + weight INT NOT NULL default '11' +); +# -------------------------------------------------------- + + +# +# Table structure for table exercise_rubrics +# + +CREATE TABLE prefix_exercise_rubrics ( + id SERIAL8 PRIMARY KEY, + exerciseid INT8 NOT NULL default '0', + elementno INT8 NOT NULL default '0', + rubricno INT NOT NULL default '0', + description text NOT NULL +); +# -------------------------------------------------------- + +# +# Table structure for table exercise_grades +# + +CREATE TABLE prefix_exercise_grades ( + id SERIAL8 PRIMARY KEY, + exerciseid INT8 NOT NULL default '0', + assessmentid INT8 NOT NULL default '0', + elementno INT8 NOT NULL default '0', + feedback text NOT NULL default '', + grade INT NOT NULL default '0' +); + +CREATE INDEX prefix_exercise_grades_assessmentid_idx ON prefix_exercise_grades (assessmentid); +# -------------------------------------------------------- + + + +INSERT INTO prefix_log_display VALUES ('exercise', 'close', 'exercise', 'name'); +INSERT INTO prefix_log_display VALUES ('exercise', 'open', 'exercise', 'name'); +INSERT INTO prefix_log_display VALUES ('exercise', 'submit', 'exercise', 'name'); +INSERT INTO prefix_log_display VALUES ('exercise', 'view', 'exercise', 'name'); +INSERT INTO prefix_log_display VALUES ('exercise', 'update', 'exercise', 'name'); + -- 2.39.5