From: piers Date: Fri, 1 Aug 2008 02:32:36 +0000 (+0000) Subject: MDL-14902 Missing column 'whatgrade' in prefix_scorm table. Is a DB patch (thanks... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=c57ce9f2513fb5f4e3a2856c3eeea547e42d9f7e;p=moodle.git MDL-14902 Missing column 'whatgrade' in prefix_scorm table. Is a DB patch (thanks Hans de Zwart). --- diff --git a/mod/scorm/db/install.xml b/mod/scorm/db/install.xml index 3b4c99bc90..1386d83135 100644 --- a/mod/scorm/db/install.xml +++ b/mod/scorm/db/install.xml @@ -13,8 +13,9 @@ - - + + + diff --git a/mod/scorm/db/upgrade.php b/mod/scorm/db/upgrade.php index e27bd650fd..31064785e6 100644 --- a/mod/scorm/db/upgrade.php +++ b/mod/scorm/db/upgrade.php @@ -21,11 +21,27 @@ function xmldb_scorm_upgrade($oldversion=0) { global $CFG, $THEME, $DB; + $dbman = $DB->get_manager(); + $result = true; //===== 1.9.0 upgrade line ======// + // Adding missing 'whatgrade' field to table scorm + if ($result && $oldversion < 2008073000) { + $table = new xmldb_table('scorm'); + $field = new xmldb_field('whatgrade'); + $field->set_attributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'grademethod'); + + /// Launch add field whatgrade + if(!$dbman->field_exists($table,$field)) { + $dbman->add_field($table, $field); + } + + upgrade_mod_savepoint($result, 2008073000, 'scorm'); + } + return $result; } -?> +?> \ No newline at end of file diff --git a/mod/scorm/version.php b/mod/scorm/version.php index 50c9bc1048..98ca6a37a5 100755 --- a/mod/scorm/version.php +++ b/mod/scorm/version.php @@ -10,8 +10,8 @@ // catch up now, so until 27th October please only increment in very tiny steps // in HEAD, until we get past that date.. -$module->version = 2007110500; // The (date) version of this module +$module->version = 2008073100; // The (date) version of this module $module->requires = 2007101509; // The version of Moodle that is required $module->cron = 300; // How often should cron check this module (seconds)? -?> +?> \ No newline at end of file