From 8e57185e308a23f8eb27ae59854b0257a13d508c Mon Sep 17 00:00:00 2001 From: "Jonathan.Wage" Date: Thu, 13 Sep 2007 22:39:52 +0000 Subject: [PATCH] Fixes. --- lib/Doctrine/Export/Schema.php | 9 +++++++-- tests/schema.xml | 8 ++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/lib/Doctrine/Export/Schema.php b/lib/Doctrine/Export/Schema.php index e64660696..e14de88bb 100644 --- a/lib/Doctrine/Export/Schema.php +++ b/lib/Doctrine/Export/Schema.php @@ -124,8 +124,7 @@ abstract class Doctrine_Export_Schema // and currently declared classes foreach ($tables as $name) { $class = new ReflectionClass($name); - $conn = Doctrine_Manager::getInstance()->getConnectionForComponent($name); - + // check if class is an instance of Doctrine_Record and not abstract // class must have method setTableDefinition (to avoid non-Record subclasses like symfony's sfDoctrineRecord) // we have to recursively iterate through the class parents just to be sure that the classes using for example @@ -154,6 +153,12 @@ abstract class Doctrine_Export_Schema $table = array(); $table['name'] = $data['tableName']; $table['class'] = get_class($record); + + foreach ($data['columns'] AS $name => $column) + { + $data['columns'][$name]['name'] = $name; + } + $table['columns'] = $data['columns']; $array['tables'][$data['tableName']] = $table; diff --git a/tests/schema.xml b/tests/schema.xml index 151bbc17a..f57b66b17 100755 --- a/tests/schema.xml +++ b/tests/schema.xml @@ -1,7 +1,7 @@ - + user User @@ -18,9 +18,9 @@ true -
+ - + group Group @@ -37,6 +37,6 @@ true -
+
\ No newline at end of file