diff --git a/lib/Doctrine/Builder/Migration.php b/lib/Doctrine/Builder/Migration.php index 957d73ce2..3dcced80e 100644 --- a/lib/Doctrine/Builder/Migration.php +++ b/lib/Doctrine/Builder/Migration.php @@ -157,10 +157,10 @@ END; { if ($modelsPath) { $models = Doctrine::loadModels($modelsPath); - } else { - $models = Doctrine::getLoadedModels(); } + $models = Doctrine::getLoadedModels(); + $foreignKeys = array(); foreach ($models as $model) { diff --git a/lib/Doctrine/Export.php b/lib/Doctrine/Export.php index 00e733d40..f31ee19ea 100644 --- a/lib/Doctrine/Export.php +++ b/lib/Doctrine/Export.php @@ -1047,10 +1047,10 @@ class Doctrine_Export extends Doctrine_Connection_Module { if ($directory !== null) { $models = Doctrine::loadModels($directory); - } else { - $models = Doctrine::getLoadedModels(); } + $models = Doctrine::getLoadedModels(); + $this->exportClasses($models); } diff --git a/lib/Doctrine/Export/Schema.php b/lib/Doctrine/Export/Schema.php index 91f8fdb17..ddaeeea10 100644 --- a/lib/Doctrine/Export/Schema.php +++ b/lib/Doctrine/Export/Schema.php @@ -45,11 +45,11 @@ class Doctrine_Export_Schema public function buildSchema($directory = null, $models = array()) { if ($directory) { - $loadedModels = Doctrine::loadModels($directory); - } else { - $loadedModels = Doctrine::getLoadedModels(); + Doctrine::loadModels($directory); } + $loadedModels = Doctrine::getLoadedModels(); + $array = array(); $parent = new ReflectionClass('Doctrine_Record');