From: Justin Hunter Date: Sun, 21 Jun 2009 13:59:08 +0000 (-0700) Subject: cleanup of object creation X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=aad333cdaf0e96082e46d2cfe000b49c4f77a5b4;p=dbsrgits%2FSQL-Translator-2.0-ish.git cleanup of object creation --- diff --git a/lib/SQL/Translator/Parser/DBI.pm b/lib/SQL/Translator/Parser/DBI.pm index 219fc73..02fdf46 100644 --- a/lib/SQL/Translator/Parser/DBI.pm +++ b/lib/SQL/Translator/Parser/DBI.pm @@ -22,8 +22,8 @@ has 'translator' => ( _tables_list => '_tables_list', _table_columns => '_table_columns', _table_pk_info => '_table_pk_info', - _table_uniq_info => '_table_uniq_info', _table_fk_info => '_table_fk_info', + _table_uniq_info => '_table_uniq_info', _columns_info_for => '_columns_info_for', _extra_column_info => '_extra_column_info', } @@ -50,19 +50,15 @@ sub BUILD { my $translator = $class->new( dbh => $self->dbh ); $self->translator($translator); - my $tables = $self->_tables_list; - - $self->schema->tables($self->_tables_list); - $self->schema->get_table($_)->columns($self->_columns_info_for($_)) for keys %$tables; + my $tables = $self->_tables_list; print Dumper($tables); -# foreach my $table (keys %$tables) { -# my $columns = $self->_columns_info_for($table); -# my $table = $self->schema->get_table($key); -# $table->columns($columns); -# $self->schema->get_table($key)->columns($columns); -# } + $self->schema->tables($tables); - print Dumper($self->schema); + foreach my $table (keys %$tables) { + my $columns = $self->_columns_info_for($table); + $self->schema->get_table($table)->columns($columns); + } +# print Dumper($self->schema); } 1;