From: Johannes Plunien Date: Sun, 2 Nov 2008 01:59:49 +0000 (+0100) Subject: rolling back my last change, waiting until new sqlt is on cpan X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=849d23b85659bb2bc1f917f9a27492929d450c27;hp=e28ac0a3d02846742fa0313bf2a046e449ea03e8;p=dbsrgits%2FDBIx-Class-Historic.git rolling back my last change, waiting until new sqlt is on cpan --- diff --git a/Changes b/Changes index 3312505..6b93887 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,4 @@ Revision history for DBIx::Class - - Split sql statements for deploy only if SQLT::Producer returned a scalar - containing all statements to be executed 0.08099_05 2008-10-30 21:30:00 (UTC) - Rewritte of Storage::DBI::connect_info(), extended with an diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index 353e2e1..c6ca8f2 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -1753,16 +1753,14 @@ sub deployment_statements { sub deploy { my ($self, $schema, $type, $sqltargs, $dir) = @_; - my @statements = $self->deployment_statements($schema, $type, undef, $dir, { no_comments => 1, %{ $sqltargs || {} } } ); - foreach my $statement ( @statements ) { - my $deploy = sub { - my $line = shift; - return if($line =~ /^--/); - return if(!$line); + foreach my $statement ( $self->deployment_statements($schema, $type, undef, $dir, { no_comments => 1, %{ $sqltargs || {} } } ) ) { + foreach my $line ( split(";\n", $statement)) { + next if($line =~ /^--/); + next if(!$line); # next if($line =~ /^DROP/m); - return if($line =~ /^BEGIN TRANSACTION/m); - return if($line =~ /^COMMIT/m); - return if $line =~ /^\s+$/; # skip whitespace only + next if($line =~ /^BEGIN TRANSACTION/m); + next if($line =~ /^COMMIT/m); + next if $line =~ /^\s+$/; # skip whitespace only $self->_query_start($line); eval { $self->dbh->do($line); # shouldn't be using ->dbh ? @@ -1771,14 +1769,6 @@ sub deploy { warn qq{$@ (running "${line}")}; } $self->_query_end($line); - }; - if (@statements > 1) { - $deploy->( $statement ); - } - else { - foreach my $line ( split(";\n", $statement)) { - $deploy->( $line ); - } } } }