From 7556f9b06bc941d5dadab2fac36e8922ffe7b199 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 27 Sep 2000 12:47:11 +0000 Subject: [PATCH] fix pretty_read --- DBSchema.pm | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/DBSchema.pm b/DBSchema.pm index da182cd..ce3b035 100644 --- a/DBSchema.pm +++ b/DBSchema.pm @@ -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 -- 2.11.0