From 997d066f0230d6c271e2f6d7cced7bcb71470330 Mon Sep 17 00:00:00 2001 From: zYne Date: Tue, 19 Jun 2007 10:58:54 +0000 Subject: [PATCH] fixed dropTable() --- lib/Doctrine/Export.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/Doctrine/Export.php b/lib/Doctrine/Export.php index 7f101f9e8..a6680dacd 100644 --- a/lib/Doctrine/Export.php +++ b/lib/Doctrine/Export.php @@ -55,17 +55,27 @@ class Doctrine_Export extends Doctrine_Connection_Module { throw new Doctrine_Export_Exception('Drop database not supported by this driver.'); } + /** + * dropTableSql + * drop an existing table + * + * @param string $table name of table that should be dropped from the database + * @return string + */ + public function dropTableSql($table) + { + return 'DROP TABLE ' . $this->conn->quoteIdentifier($table); + } /** * dropTable * drop an existing table * * @param string $table name of table that should be dropped from the database - * @throws PDOException * @return void */ public function dropTable($table) { - $this->conn->execute('DROP TABLE ' . $table); + $this->conn->execute($this->dropTableSql($table)); } /** @@ -1004,7 +1014,7 @@ class Doctrine_Export extends Doctrine_Connection_Module } } /** Not needed anymore ? createTable() now handles foreign keys - + foreach ($fks as $tableName => $fk) { foreach ($fk as $k => $definition) { if (is_array($definition)) {