From: Ash Berlin Date: Wed, 1 Nov 2006 02:11:22 +0000 (+0000) Subject: reverted previous deploy change(r8255) - sorry matt, i wont break it again X-Git-Tag: v0.07003~13 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ae9a0fa0deca24bb6e472800f7e9e82374120b7b;p=dbsrgits%2FDBIx-Class.git reverted previous deploy change(r8255) - sorry matt, i wont break it again --- diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index f739aff..cb61070 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -1099,23 +1099,18 @@ L. sub deploy { my ($self, $schema, $type, $sqltargs, $dir) = @_; - my @statements = $self->deployment_statements($schema, $type, undef, $dir, { no_comments => 1, %{ $sqltargs || {} } } ); - - if (scalar @statements == 1) { - @statements = split(";\n", $statements[0]); - $type ||= $self->sqlt_type; - # If we got more stmts out from splitting, display a warning - carp "SQL::Translator::Producer:${type}->produce only returned a single scalar for multiple statements.\n" - if (scalar @statements != 1); - } - - foreach (@statements) { - next if($_ =~ /^\s*$/s); + foreach my $statement ( $self->deployment_statements($schema, $type, undef, $dir, { no_comments => 1, %{ $sqltargs || {} } } ) ) { + for ( split(";\n", $statement)) { + next if($_ =~ /^--/); + next if(!$_); +# next if($_ =~ /^DROP/m); next if($_ =~ /^BEGIN TRANSACTION/m); next if($_ =~ /^COMMIT/m); + next if $_ =~ /^\s+$/; # skip whitespace only $self->debugobj->query_start($_) if $self->debug; $self->dbh->do($_) or warn "SQL was:\n $_"; $self->debugobj->query_end($_) if $self->debug; + } } }