Use $oldTableName in CloneDatabase. The dropTable() appends the prefix, so $oldTableName becomes $newTableName

This commit is contained in:
X! 2010-12-31 02:18:25 +00:00
parent 28bc1ef531
commit f70c2b987c

View 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 );
}
}
/**