Postgres updates

This commit is contained in:
paca70 2004-09-20 17:48:59 +00:00
parent be784d1a77
commit 0257cc73e0
3 changed files with 93 additions and 19 deletions

View File

@ -62,6 +62,11 @@ function forum_upgrade($oldversion) {
);");
}
if ($oldversion < 2004070700) { // This may be redoing it from STABLE but that's OK
table_column("forum_discussions", "groupid", "groupid", "integer", "10", "", "0", "");
}
return true;
}

View File

@ -23,13 +23,75 @@ function workshop_upgrade($oldversion) {
)
");
}
return true;
if ($oldversion < 2003051400) {
table_column("workshop","","showleaguetable", "INTEGER", "4", "unsigned", "0", "not null", "gradingweight");
execute_sql("
CREATE TABLE {$CFG->prefix}workshop_rubrics (
id SERIAL8 PRIMARY KEY,
workshopid int8 NOT NULL default '0',
elementid int8 NOT NULL default '0',
rubricno int4 NOT NULL default '0',
description text NOT NULL,
)
");
}
if ($oldversion < 2003082200) {
table_column("workshop_rubrics", "elementid", "elementno", "INTEGER", "10", "unsigned", "0", "not null", "id");
}
if ($oldversion < 2003092500) {
table_column("workshop", "", "overallocation", "INTEGER", "4", "unsigned", "0", "not null", "nsassesments");
}
if ($oldversion < 2003100200) {
table_column("workshop_assesments", "", "resubmission", "INTEGER", "4", "unsigned", "0", "not null", "mailed");
}
if ($oldversion < 2003100800) {
// tidy up log_display entries
execute_sql("DELETE FROM {$CFG->prefix}log_display WHERE module = 'workshop'");
execute_sql("INSERT INTO {$CFG->prefix}log_display VALUES('workshop', 'assessments', 'workshop', 'name')");
execute_sql("INSERT INTO {$CFG->prefix}log_display VALUES ('workshop', 'close', 'workshop', 'name')");
execute_sql("INSERT INTO {$CFG->prefix}log_display VALUES ('workshop', 'display', 'workshop', 'name')");
execute_sql("INSERT INTO {$CFG->prefix}log_display VALUES ('workshop', 'resubmit', 'workshop', 'name')");
execute_sql("INSERT INTO {$CFG->prefix}log_display VALUES ('workshop', 'set up', 'workshop', 'name')");
execute_sql("INSERT INTO {$CFG->prefix}log_display VALUES ('workshop', 'submissions', 'workshop', 'name')");
execute_sql("INSERT INTO {$CFG->prefix}log_display VALUES ('workshop', 'view', 'workshop', 'name')");
execute_sql("INSERT INTO {$CFG->prefix}log_display VALUES ('workshop', 'update', 'workshop', 'name')");
}
if ($oldversion < 2003113000) {
table_column("workshop", "", "teacherloading", "INTEGER", "4", "unsigned", "5", "NOT NULL", "mailed");
table_column("workshop", "", "assessmentstodrop", "INTEGER", "4", "unsigned", "0", "NOT NULL", "");
table_column("workshop_assessments", "", "donotuse", "INTEGER", "4", "unsigned", "0", "NOT NULL", "resubmission");
execute_sql("CREATE INDEX {$CFG->prefix}workshop_grades_assesmentid_idx (assessmentid)");
}
if ($oldversion < 2004052100) {
include_once("$CFG->dirroot/mod/workshop/lib.php");
workshop_refresh_events();
}
}
if ($oldversion < 2004081100) {
table_column("workshop", "", "gradinggrade", "INTEGER", "4", "UNSIGNED", "0", "NOT NULL", "grade");
table_column("workshop", "", "assessmentcomps", "INTEGER", "4", "UNSIGNED", "2", "NOT NULL", "ntassessments");
execute_sql("ALTER TABLE {$CFG->prefix}workshop DROP COLUMN gradingweight");
execute_sql("ALTER TABLE {$CFG->prefix}workshop DROP COLUMN mergegrades");
execute_sql("ALTER TABLE {$CFG->prefix}workshop DROP COLUMN peerweight");
execute_sql("ALTER TABLE {$CFG->prefix}workshop DROP COLUMN includeteachersgrade");
execute_sql("ALTER TABLE {$CFG->prefix}workshop DROP COLUMN biasweight");
execute_sql("ALTER TABLE {$CFG->prefix}workshop DROP COLUMN reliabilityweight");
execute_sql("ALTER TABLE {$CFG->prefix}workshop DROP COLUMN teacherloading");
execute_sql("ALTER TABLE {$CFG->prefix}workshop DROP COLUMN assessmentstodrop");
}
return true;
}
?>

View File

@ -19,18 +19,14 @@ CREATE TABLE prefix_workshop (
maxbytes INT8 NOT NULL default '100000',
deadline INT8 NOT NULL default '0',
grade INT8 NOT NULL default '0',
gradinggrade INT4 NOT NULL default '0',
ntassessments INT NOT NULL default '0',
assessmentcomps int4 NOT NULL default '2',
nsassessments INT NOT NULL default '0',
overallocation INT NOT NULL default '0',
timemodified INT8 NOT NULL default '0',
mergegrades INT NOT NULL default '0',
teacherweight INT NOT NULL default '5',
peerweight INT NOT NULL default '5',
includeteachersgrade INT NOT NULL default '0',
biasweight INT NOT NULL default '5',
reliabilityweight INT NOT NULL default '5',
gradingweight INT NOT NULL default '5',
timeagreed INT8 NOT NULL default '0'
teacherweight INT NOT NULL default '1',
showleaguetable INT4 NOT NULL default '0',
);
# --------------------------------------------------------
@ -66,10 +62,12 @@ CREATE TABLE prefix_workshop_assessments (
userid INT8 NOT NULL default '0',
timecreated INT8 NOT NULL default '0',
timegraded INT8 NOT NULL default '0',
timeagreed INT8 NOT NULL default '0',
grade float NOT NULL default '0',
gradinggrade INT NOT NULL default '0',
mailed INT2 NOT NULL default '0',
resubmission INT2 NOT NULL default '0',
donotuse int4 NOT NULL default '0',
generalcomment text NOT NULL default '',
teachercomment text NOT NULL default ''
);
@ -88,7 +86,17 @@ CREATE TABLE prefix_workshop_elements (
maxscore INT NOT NULL default '1',
weight float NOT NULL default '1.0'
);
# --------------------------------------------------------
CREATE TABLE prefix_workshop_rubrics (
id SERIAL PRIMARY KEY,
workshopid int8 NOT NULL default '0',
elementno int8 NOT NULL default '0',
rubricno int4 NOT NULL default '0',
description text NOT NULL
) ;
# --------------------------------------------------------
#
# Table structure for table workshop_grades
@ -113,14 +121,13 @@ CREATE TABLE prefix_workshop_comments (
comments text NOT NULL default ''
);
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');
INSERT INTO `prefix_log_display` VALUES ('workshop', 'resubmit', 'workshop', 'name');
INSERT INTO `prefix_log_display` VALUES ('workshop', 'set up', 'workshop', 'name');
INSERT INTO `prefix_log_display` VALUES ('workshop', 'submissions', 'workshop', 'name');
INSERT INTO `prefix_log_display` VALUES ('workshop', 'view', 'workshop', 'name');
INSERT INTO `prefix_log_display` VALUES ('workshop', 'update', 'workshop', 'name');
INSERT INTO prefix_log_display VALUES ('workshop', 'assess', 'workshop', 'name');
INSERT INTO prefix_log_display VALUES ('workshop', 'close', 'workshop', 'name');
INSERT INTO prefix_log_display VALUES ('workshop', 'display grades', 'workshop', 'name');
INSERT INTO prefix_log_display VALUES ('workshop', 'grade', 'workshop', 'name');
INSERT INTO prefix_log_display VALUES ('workshop', 'hide grades', 'workshop', 'name');
INSERT INTO prefix_log_display VALUES ('workshop', 'open', 'workshop', 'name');
INSERT INTO prefix_log_display VALUES ('workshop', 'submit', 'workshop', 'name');
INSERT INTO prefix_log_display VALUES ('workshop', 'view', 'workshop', 'name');
INSERT INTO prefix_log_display VALUES ('workshop', 'update', 'workshop', 'name');
COMMIT;