From: Arthur Axel 'fREW' Schmidt Date: Sat, 20 Mar 2010 17:10:03 +0000 (-0500) Subject: remove dead code from _deploy_statements X-Git-Tag: v0.001000_01~82 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3a47afb41d1e41079aafeb34ab1fb46d77964117;p=dbsrgits%2FDBIx-Class-DeploymentHandler.git remove dead code from _deploy_statements --- diff --git a/lib/DBIx/Class/DeploymentHandler/DeployMethod/SQL/Translator.pm b/lib/DBIx/Class/DeploymentHandler/DeployMethod/SQL/Translator.pm index 129000c..4b6c9f5 100644 --- a/lib/DBIx/Class/DeploymentHandler/DeployMethod/SQL/Translator.pm +++ b/lib/DBIx/Class/DeploymentHandler/DeployMethod/SQL/Translator.pm @@ -143,43 +143,16 @@ method _ddl_schema_down_produce_filename($type, $versions, $dir) { } method _deployment_statements { - my $dir = $self->upgrade_directory; - my $schema = $self->schema; my $type = $self->storage->sqlt_type; - my $sqltargs = $self->sqltargs; my $version = $self->schema_version; - my @filenames = @{$self->_ddl_schema_consume_filenames($type, $version)}; - - for my $filename (@filenames) { - if(-f $filename) { - my $file; - open $file, q(<), $filename - or carp "Can't open $filename ($!)"; - my @rows = <$file>; - close $file; - return join '', @rows; - } + for my $filename (@{$self->_ddl_schema_consume_filenames($type, $version)}) { + open my $file, q(<), $filename + or carp "Can't open $filename ($!)"; + my @rows = <$file>; + close $file; + return join '', @rows; } - - # sources needs to be a parser arg, but for simplicty allow at top level - # coming in - $sqltargs->{parser_args}{sources} = delete $sqltargs->{sources} - if exists $sqltargs->{sources}; - - my $tr = SQL::Translator->new( - producer => "SQL::Translator::Producer::${type}", - %$sqltargs, - parser => 'SQL::Translator::Parser::DBIx::Class', - data => $schema, - ); - - my $ret = $tr->translate; - - $schema->throw_exception( 'Unable to produce deployment statements: ' . $tr->error) - unless defined $ret; - - return $ret; } sub _deploy {