From d5d2f8a6f05bea6b284a1e47c3f9a642ec16f18f Mon Sep 17 00:00:00 2001 From: stronk7 Date: Fri, 21 Sep 2007 08:48:51 +0000 Subject: [PATCH] Adding the new context_temp permanet table to be used by build_context_path() . MDL-11347 --- lib/db/install.xml | 18 ++++++++++++++---- lib/db/upgrade.php | 20 +++++++++++++++++++- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/lib/db/install.xml b/lib/db/install.xml index 5603c1ff5d..20c726f40f 100644 --- a/lib/db/install.xml +++ b/lib/db/install.xml @@ -1,5 +1,5 @@ - @@ -830,7 +830,7 @@ - +
@@ -843,7 +843,17 @@
- +
+ + + + + + + + +
+ @@ -1754,4 +1764,4 @@ - \ No newline at end of file + diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index 197a00ac4b..25bbd1b47d 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -2093,7 +2093,25 @@ function xmldb_main_upgrade($oldversion=0) { $result = $result && create_table($table); } - if ($result && $oldversion < 2007092000) { + +/// Create the permanent context_temp table to be used by build_context_path() + if ($result && $oldversion < 2007092001) { + + /// Define table context_temp to be created + $table = new XMLDBTable('context_temp'); + + /// Adding fields to table context_temp + $table->addFieldInfo('id', XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, null); + $table->addFieldInfo('path', XMLDB_TYPE_CHAR, '255', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, null); + $table->addFieldInfo('depth', XMLDB_TYPE_INTEGER, '2', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, null); + + /// Adding keys to table context_temp + $table->addKeyInfo('primary', XMLDB_KEY_PRIMARY, array('id')); + + /// Launch create table for context_temp + $result = $result && create_table($table); + + /// Recalculate depths, paths and so on cleanup_contexts(); build_context_path(true); load_all_capabilities(); -- 2.39.5