diff --git a/mod/hotpot/db/postgres7.php b/mod/hotpot/db/postgres7.php index fc972b1424c..e5d52522177 100644 --- a/mod/hotpot/db/postgres7.php +++ b/mod/hotpot/db/postgres7.php @@ -41,6 +41,50 @@ function hotpot_upgrade($oldversion) { require_once $update_to_v2; $ok = $ok && hotpot_update_to_v2_1_18(); } - return $ok; + + + if ($oldversion < 2006050201) { + + modify_database('', 'ALTER TABLE prefix_hotpot + ALTER COLUMN studentfeedbackurl SET DEFAULT \'\', + ALTER COLUMN studentfeedbackurl SET NOT NULL, + ALTER COLUMN clickreporting SET DEFAULT 0, + ALTER COLUMN studentfeedback SET DEFAULT 0'); + + modify_database('', 'ALTER TABLE prefix_hotpot_strings + ALTER COLUMN string SET DEFAULT \'\''); + + modify_database('', 'ALTER TABLE prefix_hotpot_responses + ALTER COLUMN hints TYPE int2, + ALTER COLUMN hints SET DEFAULT 0, + ALTER COLUMN ignored SET DEFAULT \'\', + ALTER COLUMN ignored SET NOT NULL, + ALTER COLUMN score TYPE int2, + ALTER COLUMN score SET DEFAULT 0, + ALTER COLUMN correct SET DEFAULT \'\', + ALTER COLUMN correct SET NOT NULL, + ALTER COLUMN weighting TYPE int2, + ALTER COLUMN weighting SET DEFAULT 0, + ALTER COLUMN wrong SET DEFAULT \'\', + ALTER COLUMN wrong SET NOT NULL, + ALTER COLUMN checks TYPE int2, + ALTER COLUMN checks SET DEFAULT 0, + ALTER COLUMN clues TYPE int2, + ALTER COLUMN clues SET DEFAULT 0'); + + modify_database('', 'ALTER TABLE prefix_hotpot_questions + ALTER COLUMN "type" SET DEFAULT 0'); + + modify_database('', 'ALTER TABLE prefix_hotpot_attempts + ALTER COLUMN penalties TYPE smallint, + ALTER COLUMN penalties SET DEFAULT 0, + ALTER COLUMN score TYPE smallint, + ALTER COLUMN score SET DEFAULT 0, + ALTER COLUMN status SET DEFAULT 1'); + + } + + + return $ok; } ?> diff --git a/mod/hotpot/version.php b/mod/hotpot/version.php index 01536b46efd..478726b5f60 100644 --- a/mod/hotpot/version.php +++ b/mod/hotpot/version.php @@ -3,7 +3,7 @@ /// Code fragment to define the version of hotpot /// This fragment is called by moodle_needs_upgrading() and /admin/index.php ///////////////////////////////////////////////////////////////////////////////// -$module->version = 2006050200; // release date of this version (see note below) +$module->version = 2006050201; // release date of this version (see note below) $module->release = 'v2.1.19'; // human-friendly version name (used in mod/hotpot/lib.php) $module->cron = 0; // period for cron to check this module (secs) // interpretation of YYYYMMDDXY version numbers