Commit 3b0f749a authored by Jonathan.Wage's avatar Jonathan.Wage

Fixes for multiple connection handling.

parent 7bbcb51d
...@@ -185,17 +185,21 @@ class Doctrine_Import extends Doctrine_Connection_Module ...@@ -185,17 +185,21 @@ class Doctrine_Import extends Doctrine_Connection_Module
*/ */
public function importSchema($directory, array $databases = array()) public function importSchema($directory, array $databases = array())
{ {
$builder = new Doctrine_Import_Builder(); $connections = Doctrine_Manager::getInstance()->getConnections();
$builder->setTargetPath($directory);
foreach ($connections as $connection) {
$builder = new Doctrine_Import_Builder();
$builder->setTargetPath($directory);
$classes = array(); $classes = array();
foreach ($this->listTables() as $table) { foreach ($connection->import->listTables() as $table) {
$builder->buildRecord(array('tableName' => $table, $builder->buildRecord(array('tableName' => $table,
'className' => Doctrine::classify($table)), 'className' => Doctrine::classify($table)),
$this->listTableColumns($table), $connection->import->listTableColumns($table),
array()); array());
$classes[] = Doctrine::classify($table); $classes[] = Doctrine::classify($table);
}
} }
return $classes; return $classes;
......
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