diff --git a/lib/db/install.xml b/lib/db/install.xml
index 1d88b4d12cc..22835b232a0 100644
--- a/lib/db/install.xml
+++ b/lib/db/install.xml
@@ -1130,7 +1130,8 @@
-
+
+
diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php
index f50ae6b2798..1a98860c7fa 100644
--- a/lib/db/upgrade.php
+++ b/lib/db/upgrade.php
@@ -899,6 +899,21 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2012062500.02);
}
+ if ($oldversion < 2012062500.04) {
+
+ // 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, 2012062500.04);
+ }
+
return true;
}
diff --git a/version.php b/version.php
index 0e59d871b3e..b281bb412c3 100644
--- a/version.php
+++ b/version.php
@@ -30,7 +30,7 @@
defined('MOODLE_INTERNAL') || die();
-$version = 2012062500.03; // YYYYMMDD = weekly release date of this DEV branch
+$version = 2012062500.04; // YYYYMMDD = weekly release date of this DEV branch
// RR = release increments - 00 in DEV branches
// .XX = incremental changes