From: Justin Hunter Date: Sun, 23 Aug 2009 07:05:19 +0000 (-0700) Subject: don't pass columns to constructors, add_column them X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f350b918ac5bbd5bc97ef82a775f5a9fc00d4447;p=dbsrgits%2FSQL-Translator-2.0-ish.git don't pass columns to constructors, add_column them --- diff --git a/lib/SQL/Translator/Parser/DDL/PostgreSQL.pm b/lib/SQL/Translator/Parser/DDL/PostgreSQL.pm index 87441e0..d73412c 100644 --- a/lib/SQL/Translator/Parser/DDL/PostgreSQL.pm +++ b/lib/SQL/Translator/Parser/DDL/PostgreSQL.pm @@ -70,8 +70,10 @@ sort { ( $result->{tables}{ $a }{'order'} || 0 ) <=> ( $result->{tables}{ $b }{' my $index = Index->new({ name => $idata->{name}, type => uc $idata->{type}, - columns => $idata->{fields}, + table => $table, }); + $index->add_column($table->get_column($_)) for @{$idata->{fields}}; + $table->add_index($index); } for my $cdata ( @{ $tdata->{'constraints'} || [] } ) { @@ -97,7 +99,6 @@ sort { ( $result->{tables}{ $a }{'order'} || 0 ) <=> ( $result->{tables}{ $b }{' my $view = View->new({ name => $vinfo->{view_name}, sql => $sql, -# columns => $vinfo->{fields}, }); $schema->add_view($view);