[Bast-commits] r3512 - trunk/DBIx-Class/lib/DBIx/Class/Storage

matthewt at dev.catalyst.perl.org matthewt at dev.catalyst.perl.org
Tue Jun 19 18:58:03 GMT 2007


Author: matthewt
Date: 2007-06-19 18:58:03 +0100 (Tue, 19 Jun 2007)
New Revision: 3512

Modified:
   trunk/DBIx-Class/lib/DBIx/Class/Storage/DBI.pm
Log:
make errors during deploy soft

Modified: trunk/DBIx-Class/lib/DBIx/Class/Storage/DBI.pm
===================================================================
--- trunk/DBIx-Class/lib/DBIx/Class/Storage/DBI.pm	2007-06-19 00:21:56 UTC (rev 3511)
+++ trunk/DBIx-Class/lib/DBIx/Class/Storage/DBI.pm	2007-06-19 17:58:03 UTC (rev 3512)
@@ -1403,16 +1403,21 @@
 sub deploy {
   my ($self, $schema, $type, $sqltargs, $dir) = @_;
   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($_); # shouldn't be using ->dbh ?
-      $self->debugobj->query_end($_) if $self->debug;
+    foreach my $line ( split(";\n", $statement)) {
+      next if($line =~ /^--/);
+      next if(!$line);
+#      next if($line =~ /^DROP/m);
+      next if($line =~ /^BEGIN TRANSACTION/m);
+      next if($line =~ /^COMMIT/m);
+      next if $line =~ /^\s+$/; # skip whitespace only
+      $self->debugobj->query_start($line) if $self->debug;
+      eval {
+        $self->dbh->do($line); # shouldn't be using ->dbh ?
+      };
+      if ($@) {
+        warn qq{$@ (running "${line}")};
+      }
+      $self->debugobj->query_end($line) if $self->debug;
     }
   }
 }




More information about the Bast-commits mailing list