diff --git a/lib/db/install.xml b/lib/db/install.xml index dbbdf928ba4..dec9959b3d8 100644 --- a/lib/db/install.xml +++ b/lib/db/install.xml @@ -1274,7 +1274,9 @@ - + + + diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index bbb0dd33d48..88cf92b3392 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -1000,7 +1000,24 @@ function xmldb_main_upgrade($oldversion=0) { $result = $result && create_table($table); } - + if ($result && $oldversion < 2007042600) { + + /// Define field timecreated to be added to grade_categories + $table = new XMLDBTable('grade_categories'); + $field = new XMLDBField('timecreated'); + $field->setAttributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, null, 'hidden'); + + /// Launch add field timecreated + $result = $result && add_field($table, $field); + + /// Define field timemodified to be added to grade_categories + $table = new XMLDBTable('grade_categories'); + $field = new XMLDBField('timemodified'); + $field->setAttributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, null, 'timecreated'); + + /// Launch add field timemodified + $result = $result && add_field($table, $field); + } return $result;