moodle16cleanup: mod/hotpot set the correct column datatype and default

value
This commit is contained in:
martinlanghoff
2006-05-17 06:19:34 +00:00
parent 4ff35d69bc
commit 100aa1d7be
2 changed files with 46 additions and 2 deletions
+45 -1
View File
@@ -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;
}
?>
+1 -1
View File
@@ -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