Merge branch 'wip-MDL-29332-master-3' of git://github.com/marinaglancy/moodle
[moodle.git] / lib / db / upgrade.php
index ddcb0f5..469b6ab 100644 (file)
@@ -2223,5 +2223,20 @@ function xmldb_main_upgrade($oldversion) {
         upgrade_main_savepoint(true, 2016091900.00);
     }
 
+    if ($oldversion < 2016091900.02) {
+
+        // Define index attemptstepid-name (unique) to be dropped from question_attempt_step_data.
+        $table = new xmldb_table('question_attempt_step_data');
+        $index = new xmldb_index('attemptstepid-name', XMLDB_INDEX_UNIQUE, array('attemptstepid', 'name'));
+
+        // Conditionally launch drop index attemptstepid-name.
+        if ($dbman->index_exists($table, $index)) {
+            $dbman->drop_index($table, $index);
+        }
+
+        // Main savepoint reached.
+        upgrade_main_savepoint(true, 2016091900.02);
+    }
+
     return true;
 }