3 // This file keeps track of upgrades to
6 // Sometimes, changes between versions involve
7 // alterations to database structures and other
8 // major things that may break installations.
10 // The upgrade function in this file will attempt
11 // to perform all the necessary actions to upgrade
12 // your older installtion to the current version.
14 // If there's something it cannot do itself, it
15 // will tell you what you need to do.
17 // The commands in here will all be database-neutral,
18 // using the methods of database_manager class
20 function xmldb_scorm_upgrade($oldversion=0) {
22 global $CFG, $THEME, $DB;
24 $dbman = $DB->get_manager();
28 //===== 1.9.0 upgrade line ======//
30 // Adding missing 'whatgrade' field to table scorm
31 if ($result && $oldversion < 2008073000) {
32 $table = new xmldb_table('scorm');
33 $field = new xmldb_field('whatgrade');
34 $field->set_attributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'grademethod');
36 /// Launch add field whatgrade
37 if(!$dbman->field_exists($table,$field)) {
38 $dbman->add_field($table, $field);
41 upgrade_mod_savepoint($result, 2008073000, 'scorm');