bug related to postgres - inserts into prefix_exercise_assessments were failing,
because generalcomment and teachercomment were not null and didn't have defaults. for some reason mysql allows this but postgres complains. I've set empty string defaults and added into mysql for consistency.
This commit is contained in:
@@ -30,6 +30,10 @@ function exercise_upgrade($oldversion) {
|
||||
table_column("exercise", "", "password", "VARCHAR", "32", "", "", "NOT NULL");
|
||||
}
|
||||
|
||||
if ($oldversion < 2004091000) {
|
||||
table_column("exercise_assessments","generalcomment","generalcomment","text","","","","NOT NULL");
|
||||
table_column("exercise_assessments","teachercomment","teachercomment","text","","","","NOT NULL");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -57,8 +57,8 @@ CREATE TABLE `prefix_exercise_assessments` (
|
||||
`grade` float NOT NULL default '0',
|
||||
`gradinggrade` int(3) NOT NULL default '0',
|
||||
`mailed` tinyint(2) unsigned NOT NULL default '0',
|
||||
`generalcomment` text NOT NULL,
|
||||
`teachercomment` text NOT NULL,
|
||||
`generalcomment` text NOT NULL default '',
|
||||
`teachercomment` text NOT NULL default '',
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX (`submissionid`),
|
||||
INDEX (`userid`)
|
||||
|
||||
@@ -20,6 +20,10 @@ function exercise_upgrade($oldversion) {
|
||||
table_column("exercise", "", "password", "VARCHAR", "32", "", "", "NOT NULL");
|
||||
}
|
||||
|
||||
if ($oldversion < 2004091000) {
|
||||
table_column("exercise_assessments","generalcomment","generalcomment","text","","","","NOT NULL");
|
||||
table_column("exercise_assessments","teachercomment","teachercomment","text","","","","NOT NULL");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -55,8 +55,8 @@ CREATE TABLE prefix_exercise_assessments (
|
||||
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
|
||||
generalcomment text NOT NULL default '',
|
||||
teachercomment text NOT NULL default ''
|
||||
);
|
||||
# --------------------------------------------------------
|
||||
CREATE INDEX prefix_exercise_assessments_submissionid_idx ON prefix_exercise_assessments (submissionid);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
// This fragment is called by /admin/index.php
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
$module->version = 2004090200;
|
||||
$module->version = 2004091000;
|
||||
$module->requires = 2004052505; // Requires this Moodle version
|
||||
$module->cron = 60;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user