From: X! Date: Fri, 31 Dec 2010 02:18:25 +0000 (+0000) Subject: Use $oldTableName in CloneDatabase. The dropTable() appends the prefix, so $oldTableN... X-Git-Tag: 1.31.0-rc.0~32969 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/bilan.php?a=commitdiff_plain;h=f70c2b987c4d08812c3790168cd45160df21aaf4;p=lhc%2Fweb%2Fwiklou.git Use $oldTableName in CloneDatabase. The dropTable() appends the prefix, so $oldTableName becomes $newTableName --- diff --git a/includes/db/CloneDatabase.php b/includes/db/CloneDatabase.php index 6ca06938ba..4d22452cb4 100644 --- a/includes/db/CloneDatabase.php +++ b/includes/db/CloneDatabase.php @@ -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 ); } + } /**