From 2b1c3e4d686d059f1416270733b425e1bb5922e1 Mon Sep 17 00:00:00 2001 From: Marina Glancy Date: Tue, 20 Sep 2016 09:30:40 +0800 Subject: [PATCH] MDL-55990 tags: remove unnecessary index creation --- lib/db/upgrade.php | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index c413aa6a96c..d6bfdd70a9c 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -1149,15 +1149,6 @@ function xmldb_main_upgrade($oldversion) { // Launch add key tagcloudid. $dbman->add_key($table, $key); - // Define index tagcolltype (not unique) to be added to tag. - $table = new xmldb_table('tag'); - $index = new xmldb_index('tagcolltype', XMLDB_INDEX_NOTUNIQUE, array('tagcollid', 'tagtype')); - - // Conditionally launch add index tagcolltype. - if (!$dbman->index_exists($table, $index)) { - $dbman->add_index($table, $index); - } - // Main savepoint reached. upgrade_main_savepoint(true, 2016011300.02); } @@ -1327,6 +1318,7 @@ function xmldb_main_upgrade($oldversion) { } // Define index tagcolltype (not unique) to be dropped form tag. + // This index is no longer created however it was present at some point and it's better to be safe and try to drop it. $index = new xmldb_index('tagcolltype', XMLDB_INDEX_NOTUNIQUE, array('tagcollid', 'tagtype')); // Conditionally launch drop index tagcolltype.