[Bast-commits] r4744 - DBIx-Class/0.08/trunk/lib/DBIx/Class/Schema

lukes at dev.catalyst.perl.org lukes at dev.catalyst.perl.org
Thu Aug 7 19:35:53 BST 2008


Author: lukes
Date: 2008-08-07 19:35:52 +0100 (Thu, 07 Aug 2008)
New Revision: 4744

Modified:
   DBIx-Class/0.08/trunk/lib/DBIx/Class/Schema/Versioned.pm
Log:
separated upgrade statement execution to new method

Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Schema/Versioned.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Schema/Versioned.pm	2008-08-07 17:13:09 UTC (rev 4743)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Schema/Versioned.pm	2008-08-07 18:35:52 UTC (rev 4744)
@@ -350,13 +350,26 @@
     for (@statements)
     {      
         $self->storage->debugobj->query_start($_) if $self->storage->debug;
-        $self->storage->dbh->do($_) or warn "SQL was:\n $_";
+        $self->apply_statement($_);
         $self->storage->debugobj->query_end($_) if $self->storage->debug;
     }
 
     return 1;
 }
 
+=head2 apply_statement
+
+Takes an SQL statement and runs it. Override this if you want to handle errors
+differently.
+
+=cut
+
+sub apply_statement {
+    my ($self, $statement) = @_;
+
+    $self->storage->dbh->do($_) or warn "SQL was:\n $_";
+}
+
 =head2 get_db_version
 
 Returns the version that your database is currently at. This is determined by the values in the




More information about the Bast-commits mailing list