mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
Adding the new context_temp permanet table to be used
by build_context_path() . MDL-11347
This commit is contained in:
parent
2f6c662f41
commit
d5d2f8a6f0
2 changed files with 33 additions and 5 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue