mirror of
https://github.com/moodle/moodle.git
synced 2025-01-31 12:45:04 +01: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
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<XMLDB PATH="lib/db" VERSION="20070918" COMMENT="XMLDB file for core Moodle tables"
|
||||
<XMLDB PATH="lib/db" VERSION="20070921" COMMENT="XMLDB file for core Moodle tables"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="../../lib/xmldb/xmldb.xsd"
|
||||
>
|
||||
@ -830,7 +830,7 @@
|
||||
<INDEX NAME="path" UNIQUE="false" FIELDS="path" PREVIOUS="instanceid"/>
|
||||
</INDEXES>
|
||||
</TABLE>
|
||||
<TABLE NAME="context_rel" COMMENT="context relations, c2 is a parent (or higher) of c1" PREVIOUS="context" NEXT="capabilities">
|
||||
<TABLE NAME="context_rel" COMMENT="context relations, c2 is a parent (or higher) of c1" PREVIOUS="context" NEXT="context_temp">
|
||||
<FIELDS>
|
||||
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="c1"/>
|
||||
<FIELD NAME="c1" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" ENUM="false" COMMENT="context 1, child context" PREVIOUS="id" NEXT="c2"/>
|
||||
@ -843,7 +843,17 @@
|
||||
<KEY NAME="c1c2" TYPE="unique" FIELDS="c1, c2" PREVIOUS="c2"/>
|
||||
</KEYS>
|
||||
</TABLE>
|
||||
<TABLE NAME="capabilities" COMMENT="this defines all capabilities" PREVIOUS="context_rel" NEXT="role_allow_assign">
|
||||
<TABLE NAME="context_temp" COMMENT="Used by build_context_path() in upgrade and cron to keep context depths and paths in sync." PREVIOUS="context_rel" NEXT="capabilities">
|
||||
<FIELDS>
|
||||
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" ENUM="false" COMMENT="This id isn't autonumeric/sequence. It's the context->id" NEXT="path"/>
|
||||
<FIELD NAME="path" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="depth"/>
|
||||
<FIELD NAME="depth" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" SEQUENCE="false" ENUM="false" PREVIOUS="path"/>
|
||||
</FIELDS>
|
||||
<KEYS>
|
||||
<KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="primary key of the table, please edit me"/>
|
||||
</KEYS>
|
||||
</TABLE>
|
||||
<TABLE NAME="capabilities" COMMENT="this defines all capabilities" PREVIOUS="context_temp" NEXT="role_allow_assign">
|
||||
<FIELDS>
|
||||
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="name"/>
|
||||
<FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="captype"/>
|
||||
@ -1754,4 +1764,4 @@
|
||||
</SENTENCES>
|
||||
</STATEMENT>
|
||||
</STATEMENTS>
|
||||
</XMLDB>
|
||||
</XMLDB>
|
||||
|
@ -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…
x
Reference in New Issue
Block a user