From db07a42eda0024fb038457d35bc4586c49d64c97 Mon Sep 17 00:00:00 2001 From: nicolasconnault Date: Thu, 26 Apr 2007 03:23:45 +0000 Subject: [PATCH] MDL-9506 Added timestamps to grade_categories --- lib/db/install.xml | 4 +++- lib/db/upgrade.php | 19 ++++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/lib/db/install.xml b/lib/db/install.xml index dbbdf928ba..dec9959b3d 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 bbb0dd33d4..88cf92b339 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; -- 2.39.5