MDL-22366 upgrade - always drop DB objects conditionally
[moodle.git] / lib / db / upgrade.php
index 40be53e..06295e3 100644 (file)
@@ -101,7 +101,9 @@ function xmldb_main_upgrade($oldversion) {
         $index = new xmldb_index('contextid-lowerboundary', XMLDB_INDEX_NOTUNIQUE, array('contextid', 'lowerboundary'));
 
     /// Launch drop index contextid-lowerboundary
-        $dbman->drop_index($table, $index);
+        if ($dbman->index_exists($table, $index)) {
+            $dbman->drop_index($table, $index);
+        }
 
     /// Define index contextid-lowerboundary-letter (unique) to be added to grade_letters
         $table = new xmldb_table('grade_letters');