diff --git a/lib/db/install.xml b/lib/db/install.xml index 3a2a0544a28..2e5fb0ccfa5 100644 --- a/lib/db/install.xml +++ b/lib/db/install.xml @@ -1139,7 +1139,8 @@ - + + diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index 3a99f735499..060fc002c00 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -1030,6 +1030,21 @@ function xmldb_main_upgrade($oldversion) { upgrade_main_savepoint(true, 2012070600.10); } + if ($oldversion < 2012070600.11) { + + // Define index component-itemid-userid (not unique) to be added to role_assignments + $table = new xmldb_table('role_assignments'); + $index = new xmldb_index('component-itemid-userid', XMLDB_INDEX_NOTUNIQUE, array('component', 'itemid', 'userid')); + + // Conditionally launch add index component-itemid-userid + if (!$dbman->index_exists($table, $index)) { + $dbman->add_index($table, $index); + } + + // Main savepoint reached + upgrade_main_savepoint(true, 2012070600.11); + } + return true; } diff --git a/version.php b/version.php index 13d05c51eb5..e9bf12a696f 100644 --- a/version.php +++ b/version.php @@ -30,7 +30,7 @@ defined('MOODLE_INTERNAL') || die(); -$version = 2012070600.10; // YYYYMMDD = weekly release date of this DEV branch +$version = 2012070600.11; // YYYYMMDD = weekly release date of this DEV branch // RR = release increments - 00 in DEV branches // .XX = incremental changes