* 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
$this->db->duplicateTableStructure( $oldTableName, $newTableName, $this->useTemporaryTables );
}
+
}
/**