Skip to content

Commit

Permalink
MDL-55990 tags: remove unnecessary index creation
Browse files Browse the repository at this point in the history
  • Loading branch information
marinaglancy committed Sep 20, 2016
1 parent 1f27448 commit 2b1c3e4
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions lib/db/upgrade.php
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 2b1c3e4

Please sign in to comment.