Commit 997d066f authored by zYne's avatar zYne

fixed dropTable()

parent bbd9797d
...@@ -55,17 +55,27 @@ class Doctrine_Export extends Doctrine_Connection_Module ...@@ -55,17 +55,27 @@ class Doctrine_Export extends Doctrine_Connection_Module
{ {
throw new Doctrine_Export_Exception('Drop database not supported by this driver.'); 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 * dropTable
* drop an existing table * drop an existing table
* *
* @param string $table name of table that should be dropped from the database * @param string $table name of table that should be dropped from the database
* @throws PDOException
* @return void * @return void
*/ */
public function dropTable($table) 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 ...@@ -1004,7 +1014,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
} }
} }
/** Not needed anymore ? createTable() now handles foreign keys /** Not needed anymore ? createTable() now handles foreign keys
foreach ($fks as $tableName => $fk) { foreach ($fks as $tableName => $fk) {
foreach ($fk as $k => $definition) { foreach ($fk as $k => $definition) {
if (is_array($definition)) { if (is_array($definition)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment