From: skodak Date: Thu, 21 Feb 2008 09:27:11 +0000 (+0000) Subject: MDL-13561 add cmid index to log table to speedup reports that deal with individual... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=da4aa3e4bdded7cddfb76b5657794ad4a03e2d0d;p=moodle.git MDL-13561 add cmid index to log table to speedup reports that deal with individual activities; merged from MOODLE_19_STABLE --- diff --git a/lib/db/install.xml b/lib/db/install.xml index e8c58bff70..d254ef5243 100644 --- a/lib/db/install.xml +++ b/lib/db/install.xml @@ -288,7 +288,8 @@ - + + diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index 30e1167a4d..103282e659 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -2857,6 +2857,23 @@ function xmldb_main_upgrade($oldversion=0) { upgrade_main_savepoint($result, 2007101508.04); } + if ($result && $oldversion < 2007101508.05) { + + /// Define index cmid (not unique) to be added to log + $table = new XMLDBTable('log'); + $index = new XMLDBIndex('cmid'); + $index->setAttributes(XMLDB_INDEX_NOTUNIQUE, array('cmid')); + + /// Launch add index cmid + if (!index_exists($table, $index)) { + $result = $result && add_index($table, $index); + } + + /// Main savepoint reached + upgrade_main_savepoint($result, 2007101508.05); + } + + return $result; } diff --git a/version.php b/version.php index 79bdf90bcc..a768acc9df 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 = 2007101508.04; // YYYYMMDD = date of the 1.9 branch (don't change) + $version = 2007101508.05; // YYYYMMDD = date of the 1.9 branch (don't change) // X = release number 1.9.[0,1,2,3...] // Y = micro-increments between releases