Index: trunk/phase3/includes/db/CloneDatabase.php |
— | — | @@ -85,21 +85,21 @@ |
86 | 86 | * Clone the table structure |
87 | 87 | */ |
88 | 88 | public function cloneTableStructure() { |
89 | | - |
90 | | - sort($this->tablesToClone); |
91 | 89 | |
92 | 90 | foreach( $this->tablesToClone as $tbl ) { |
93 | 91 | # Clean up from previous aborted run. So that table escaping |
94 | 92 | # works correctly across DB engines, we need to change the pre- |
95 | 93 | # fix back and forth so tableName() works right. |
| 94 | + |
96 | 95 | $this->changePrefix( $this->oldTablePrefix ); |
97 | 96 | $oldTableName = $this->db->tableName( $tbl ); |
98 | 97 | |
99 | 98 | $this->changePrefix( $this->newTablePrefix ); |
100 | 99 | $newTableName = $this->db->tableName( $tbl ); |
101 | | - |
| 100 | + |
102 | 101 | if( $this->dropCurrentTables && !in_array( $this->db->getType(), array( 'postgres') ) ) { |
103 | | - $this->db->dropTable( $newTableName, __METHOD__ ); |
| 102 | + $this->db->dropTable( $oldTableName, __METHOD__ ); |
| 103 | + //Dropping the oldTable because the prefix was changed |
104 | 104 | } |
105 | 105 | |
106 | 106 | # Create new table |
— | — | @@ -107,6 +107,7 @@ |
108 | 108 | $this->db->duplicateTableStructure( $oldTableName, $newTableName, $this->useTemporaryTables ); |
109 | 109 | |
110 | 110 | } |
| 111 | + |
111 | 112 | } |
112 | 113 | |
113 | 114 | /** |