From: Justin Hunter Date: Sun, 23 Aug 2009 07:05:01 +0000 (-0700) Subject: add schema to Table->new and remove sorting X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0621a1677862d61e4a6219fa6219947291e0c012;p=dbsrgits%2FSQL-Translator-2.0-ish.git add schema to Table->new and remove sorting --- diff --git a/lib/SQL/Translator/Parser/DDL/PostgreSQL.pm b/lib/SQL/Translator/Parser/DDL/PostgreSQL.pm index e049e82..87441e0 100644 --- a/lib/SQL/Translator/Parser/DDL/PostgreSQL.pm +++ b/lib/SQL/Translator/Parser/DDL/PostgreSQL.pm @@ -33,15 +33,13 @@ sort { ( $result->{tables}{ $a }{'order'} || 0 ) <=> ( $result->{tables}{ $b }{' for my $table_name ( @tables ) { my $tdata = $result->{tables}{ $table_name }; - my $table = Table->new({ name => $tdata->{table_name} }); + my $table = Table->new({ name => $tdata->{table_name}, schema => $schema }); $schema->add_table($table); $table->extra(temporary => 1) if $tdata->{'temporary'}; $table->comments( $tdata->{'comments'} ); - my @fields = -sort { $tdata->{'fields'}{ $a }{'order'} <=> $tdata->{'fields'}{ $b }{'order'} } - keys %{ $tdata->{'fields'} }; + my @fields = sort { $tdata->{'fields'}{ $a }{'order'} <=> $tdata->{'fields'}{ $b }{'order'} } keys %{ $tdata->{'fields'} }; for my $fname ( @fields ) { my $fdata = $tdata->{'fields'}{ $fname };