]> git.mjollnir.org Git - moodle.git/commitdiff
Moving some uses of find_index_name() to index_exists()
authorstronk7 <stronk7>
Sat, 30 Sep 2006 15:00:46 +0000 (15:00 +0000)
committerstronk7 <stronk7>
Sat, 30 Sep 2006 15:00:46 +0000 (15:00 +0000)
lib/xmldb/classes/generators/XMLDBGenerator.class.php

index f82ce6011fec3bd1ea8ffe3a3673435bb9989a50..5a2fe8721d1687d01373ac00d62b35e62b7845ce 100644 (file)
@@ -229,7 +229,7 @@ class XMLDBgenerator {
         if ($xmldb_indexes = $xmldb_table->getIndexes()) {
             foreach ($xmldb_indexes as $xmldb_index) {
             ///Only process all this if the index doesn't exist in DB
-                if (!find_index_name($xmldb_table, $xmldb_index)) {
+                if (!index_exists($xmldb_table, $xmldb_index)) {
                     if ($indextext = $this->getCreateIndexSQL($xmldb_table, $xmldb_index)) {
                         $results = array_merge($results, $indextext);
                     }
@@ -247,7 +247,7 @@ class XMLDBgenerator {
                     $index = new XMLDBIndex('anyname');
                     $index->setFields($xmldb_key->getFields());
                 ///Only process all this if the index doesn't exist in DB
-                    if (!find_index_name($xmldb_table, $index)) {
+                    if (!index_exists($xmldb_table, $index)) {
                         $createindex = false; //By default
                         switch ($xmldb_key->getType()) {
                             case XMLDB_KEY_UNIQUE:
@@ -630,7 +630,7 @@ class XMLDBgenerator {
             }
             $xmldb_index = new XMLDBIndex('anyname');
             $xmldb_index->setAttributes($indextype, $xmldb_key->getFields());
-            if (!$indexname = find_index_name($xmldb_table, $xmldb_index)) {
+            if (!index_exists($xmldb_table, $xmldb_index)) {
                 $results = array_merge($results, $this->getAddIndexSQL($xmldb_table, $xmldb_index));
             }
         }
@@ -698,7 +698,7 @@ class XMLDBgenerator {
         /// Only if they exist
             $xmldb_index = new XMLDBIndex('anyname');
             $xmldb_index->setAttributes(XMLDB_INDEX_UNIQUE, $xmldb_key->getFields());
-            if ($indexname = find_index_name($xmldb_table, $xmldb_index)) {
+            if (index_exists($xmldb_table, $xmldb_index)) {
                 $results = array_merge($results, $this->getDropIndexSQL($xmldb_table, $xmldb_index));
             }
         }