From c7c57cfbf25cceb34aa27e30df3cd6bc8a54c84a Mon Sep 17 00:00:00 2001 From: martinlanghoff Date: Thu, 9 Aug 2007 06:14:21 +0000 Subject: [PATCH] Add context.path and context.depth fields for accesslib optimisation --- lib/db/install.xml | 10 +++++++--- lib/db/upgrade.php | 18 ++++++++++++++++++ version.php | 2 +- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/lib/db/install.xml b/lib/db/install.xml index 7491257401..e20750b92f 100644 --- a/lib/db/install.xml +++ b/lib/db/install.xml @@ -846,14 +846,18 @@ - + + + - + + + @@ -1673,4 +1677,4 @@ - \ No newline at end of file + diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index eff9fa55a2..adf1441f5a 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -1634,6 +1634,24 @@ function xmldb_main_upgrade($oldversion=0) { $result = $result && change_field_precision($table, $field); } + if ($result && $oldversion < 2007080900) { + /// Add context.path & index + $table = new XMLDBTable('context'); + $field = new XMLDBField('path'); + $field->setAttributes(XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null, null, '', 'instanceid'); + $result = $result && add_field($table, $field); + $table = new XMLDBTable('context'); + $index = new XMLDBIndex('path'); + $index->setAttributes(XMLDB_INDEX_NOTUNIQUE, array('path')); + $result = $result && add_index($table, $index); + + /// Add context.depth + $table = new XMLDBTable('context'); + $field = new XMLDBField('depth'); + $field->setAttributes(XMLDB_TYPE_INTEGER, '2', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'path'); + $result = $result && add_field($table, $field); + } + /* /// drop old gradebook tables if ($result && $oldversion < 2007072209) { diff --git a/version.php b/version.php index 8295a41df7..8dc1e648f6 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 = 2007080800; // YYYYMMDD = date + $version = 2007080900; // YYYYMMDD = date // XY = increments within a single day $release = '1.9 dev'; // Human-friendly version name -- 2.39.5