Permalink
Browse files

Updates for postgres

  • Loading branch information...
1 parent 72b9f33 commit 706552f038d7716c2f9b9f95e1ed8df73d5c2533 paca70 committed Nov 21, 2004
Showing with 39 additions and 8 deletions.
  1. +22 −0 mod/workshop/db/postgres7.php
  2. +17 −8 mod/workshop/db/postgres7.sql
@@ -113,8 +113,30 @@ function workshop_upgrade($oldversion) {
}
}
+ if ($oldversion < 2004102800) {
+ table_column("workshop", "", "releasegrades", "INTEGER", "10", "UNSIGNED", "0", "NOT NULL", "deadline");
+ execute_sql("
+ CREATE TABLE {$CFG->prefix}workshop_stockcomments (
+ id SERIAL PRIMARY KEY,
+ workshopid INT8 NOT NULL default '0',
+ elementno INT8 NOT NULL default '0',
+ comments text NOT NULL
+ )
+ ");
+ }
+ if ($oldversion < 2004111000) {
+ table_column("workshop_elements", "", "stddev", "FLOAT", "", "", "0", "NOT NULL");
+ table_column("workshop_elements", "", "totalassessments", "INTEGER", "10", "", "0", "NOT NULL");
+ table_column("workshop_elements", "weight", "weight", "INTEGER", "4", "UNSIGNED", "11", "NOT NULL");
+ table_column("workshop_submissions", "", "nassessments", "INTEGER", "10", "", "0", "NOT NULL");
+ execute_sql("ALTER TABLE {$CFG->prefix}workshop_submissions DROP COLUMN teachergrade");
+ execute_sql("ALTER TABLE {$CFG->prefix}workshop_submissions DROP COLUMN peergrade");
+ execute_sql("ALTER TABLE {$CFG->prefix}workshop_submissions DROP COLUMN biasgrade");
+ execute_sql("ALTER TABLE {$CFG->prefix}workshop_submissions DROP COLUMN reliabilitygrade");
+ }
+
return true;
}
@@ -20,6 +20,7 @@ CREATE TABLE prefix_workshop (
includeself INT2 NOT NULL default '0',
maxbytes INT8 NOT NULL default '100000',
deadline INT8 NOT NULL default '0',
+ releasegrades INT8 NOT NULL "0",
grade INT8 NOT NULL default '0',
gradinggrade INT4 NOT NULL default '0',
ntassessments INT NOT NULL default '0',
@@ -46,13 +47,11 @@ CREATE TABLE prefix_workshop_submissions (
timecreated INT8 NOT NULL default '0',
mailed INT2 NOT NULL default '0',
description TEXT,
- teachergrade INT NOT NULL default '0',
- peergrade INT NOT NULL default '0',
- biasgrade INT NOT NULL default '0',
- reliabilitygrade INT NOT NULL default '0',
gradinggrade INT NOT NULL default '0',
late INT NOT NULL DEFAULT '0',
- inalgrade INT NOT NULL default '0'
+ inalgrade INT NOT NULL default '0',
+ nassessments INT8 NOT NULL default 0
+
);
CREATE INDEX prefix_workshop_submissions_title_idx on prefix_workshop_submissions (title);
CREATE INDEX prefix_workshop_submissions_userid_idx ON prefix_workshop_submissions (userid);
@@ -78,6 +77,7 @@ CREATE TABLE prefix_workshop_assessments (
donotuse int4 NOT NULL default '0',
generalcomment text NOT NULL default '',
teachercomment text NOT NULL default ''
+
);
# --------------------------------------------------------
@@ -87,15 +87,17 @@ CREATE INDEX prefix_workshop_assessments_userid_idx ON prefix_workshop_assessmen
#
# Table structure for table workshop_elements
#
-
+
CREATE TABLE prefix_workshop_elements (
id SERIAL PRIMARY KEY,
workshopid INT8 NOT NULL default '0',
elementno INT NOT NULL default '0',
description text NOT NULL default '',
scale INT NOT NULL default '0',
maxscore INT NOT NULL default '1',
- weight float NOT NULL default '1.0'
+ weight INT4 NOT NULL default '11',
+ stddev FLOAT NOT NULL default "0",
+ totalrassesments INT8 NOT NULL DEFAULT "0"
);
# --------------------------------------------------------
@@ -131,7 +133,14 @@ CREATE TABLE prefix_workshop_comments (
mailed int2 NOT NULL default '0',
comments text NOT NULL default ''
);
-
+#---------------------------------------------------------
+CREATE TABLE prefix_workshop_stockcomments (
+ id SERIAL PRIMARY KEY,
+ workshopid INT8 NOT NULL default '0',
+ elementno INT8 NOT NULL default '0',
+ comments text NOT NULL
+);
+
INSERT INTO prefix_log_display VALUES ('workshop', 'assessments', 'workshop', 'name');
INSERT INTO prefix_log_display VALUES ('workshop', 'close', 'workshop', 'name');
INSERT INTO prefix_log_display VALUES ('workshop', 'display', 'workshop', 'name');

0 comments on commit 706552f

Please sign in to comment.