From 5adc951c4f0969576cd7e88f474ba8c4dab1c21b Mon Sep 17 00:00:00 2001 From: stronk7 Date: Thu, 28 Sep 2006 22:05:11 +0000 Subject: [PATCH] Don't rely on index names to decide if we have to drop one key --- lib/ddllib.php | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/lib/ddllib.php b/lib/ddllib.php index cf4b32e471..4922864417 100644 --- a/lib/ddllib.php +++ b/lib/ddllib.php @@ -608,15 +608,6 @@ function add_key($table, $key, $continue=true, $feedback=true) { return true; } -/// Check there isn't any index with the same fields -/// if it exists we don't create the key - $index = new XMLDBIndex('anyname'); - $index->setAttributes(XMLDB_INDEX_UNIQUE, $key->getFields()); - if ($indexexists = find_index_name($table, $index)) { - /// TODO print some notify here (id debuglevel is DEVELOPER) - return true; //Index exists, nothing to do - } - if(!$sqlarr = $table->getAddKeySQL($CFG->dbtype, $CFG->prefix, $key, false)) { return true; //Empty array = nothing to do = no error } @@ -651,15 +642,6 @@ function drop_key($table, $key, $continue=true, $feedback=true) { return true; } -/// Check there is one index with the same fields -/// if it exists we'll drop the key - $index = new XMLDBIndex('anyname'); - $index->setAttributes(XMLDB_INDEX_UNIQUE, $key->getFields()); - if (!$indexexists = find_index_name($table, $index)) { - /// TODO print some notify here (id debuglevel is DEVELOPER) - return true; //Index exists, nothing to do - } - if(!$sqlarr = $table->getDropKeySQL($CFG->dbtype, $CFG->prefix, $key, false)) { return true; //Empty array = nothing to do = no error } @@ -739,7 +721,6 @@ function drop_index($table, $index, $continue=true, $feedback=true) { return true; //Empty array = nothing to do = no error } - return execute_sql_arr($sqlarr, $continue, $feedback); } -- 2.39.5