fix pretty_read
authorivan <ivan>
Wed, 27 Sep 2000 12:47:11 +0000 (12:47 +0000)
committerivan <ivan>
Wed, 27 Sep 2000 12:47:11 +0000 (12:47 +0000)
DBSchema.pm

index da182cd..ce3b035 100644 (file)
@@ -262,18 +262,19 @@ sub pretty_read {
   my($proto, $href) = @_;
   my $schema = proto->new( map {  
     my(@columns);
-    while (@{$tables{$_}{'columns'}}) {
-      my($name,$type,$null,$length)=splice @{$tables{$_}{'columns'}}, 0, 4;
-      push @columns, new DBIx::DBSchema::Column ( $name,$type,$null,$length );
+    while ( @{$href->{$_}{'columns'}} ) {
+      push @columns, DBIx::DBSchema::Column->new(
+        splice @{$href->{$_}{'columns'}}, 0, 4
+      );
     }
     DBIx::DBSchema::Table->new(
       $_,
-      $tables{$_}{'primary_key'},
-      DBIx::DBSchema::ColGroup::Unique->new($tables{$_}{'unique'}),
-      DBIx::DBSchema::ColGroup::Index->new($tables{$_}{'index'}),
+      $href->{$_}{'primary_key'},
+      DBIx::DBSchema::ColGroup::Unique->new($href->{$_}{'unique'}),
+      DBIx::DBSchema::ColGroup::Index->new($href->{$_}{'index'}),
       @columns,
     );
-  } (keys %tables) );
+  } (keys %{$href}) );
 }
 
 # private subroutines