Use $oldTableName in CloneDatabase. The dropTable() appends the prefix, so $oldTableN...
authorX! <soxred93@users.mediawiki.org>
Fri, 31 Dec 2010 02:18:25 +0000 (02:18 +0000)
committerX! <soxred93@users.mediawiki.org>
Fri, 31 Dec 2010 02:18:25 +0000 (02:18 +0000)
includes/db/CloneDatabase.php

index 6ca0693..4d22452 100644 (file)
@@ -85,21 +85,21 @@ class CloneDatabase {
         * Clone the table structure
         */
        public function cloneTableStructure() {
-       
-               sort($this->tablesToClone);
                
                foreach( $this->tablesToClone as $tbl ) {
                        # Clean up from previous aborted run.  So that table escaping
                        # works correctly across DB engines, we need to change the pre-
                        # fix back and forth so tableName() works right.
+                       
                        $this->changePrefix( $this->oldTablePrefix );
                        $oldTableName = $this->db->tableName( $tbl );
                        
                        $this->changePrefix( $this->newTablePrefix );
                        $newTableName = $this->db->tableName( $tbl );
-
+                       
                        if( $this->dropCurrentTables && !in_array( $this->db->getType(), array( 'postgres') ) ) {
-                               $this->db->dropTable( $newTableName, __METHOD__ );
+                               $this->db->dropTable( $oldTableName, __METHOD__ );
+                               //Dropping the oldTable because the prefix was changed
                        }
 
                        # Create new table
@@ -107,6 +107,7 @@ class CloneDatabase {
                        $this->db->duplicateTableStructure( $oldTableName, $newTableName, $this->useTemporaryTables );
                        
                }
+               
        }
 
        /**