From: skodak Date: Thu, 21 Jun 2007 07:30:30 +0000 (+0000) Subject: MDL-10202 fixed locktime trouble X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=578075c615cccfb6609f8c480fde605e587b8801;p=moodle.git MDL-10202 fixed locktime trouble --- diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index dc980b767b..7e63cf4844 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -1288,15 +1288,6 @@ function xmldb_main_upgrade($oldversion=0) { $result = $result && create_table($table); } - $table = new XMLDBTable('grade_items'); - $field = new XMLDBField('locktime'); - - if (!field_exists($table, $field)) { - $locktime->setAttributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'locked'); - /// Launch add field locktime - $result = $result && add_field($table, $field); - } - /// Remove the obsoleted unitttests tables - they will be recreated automatically $tables = array('grade_categories', 'scale', @@ -1358,6 +1349,19 @@ function xmldb_main_upgrade($oldversion=0) { } + /// add new locktime field if needed + if ($result && $oldversion < 2007062008) { + + $table = new XMLDBTable('grade_items'); + $field = new XMLDBField('locktime'); + + if (!field_exists($table, $field)) { + $field->setAttributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'locked'); + /// Launch add field locktime + $result = $result && add_field($table, $field); + } + } + return $result; } diff --git a/version.php b/version.php index c562ebeb33..b005215a53 100644 --- a/version.php +++ b/version.php @@ -6,7 +6,7 @@ // This is compared against the values stored in the database to determine // whether upgrades should be performed (see lib/db/*.php) - $version = 2007062007; // YYYYMMDD = date + $version = 2007062008; // YYYYMMDD = date // XY = increments within a single day $release = '1.9 dev'; // Human-friendly version name