Hello community,

here is the log from the commit of package perl-DBIx-Class-DeploymentHandler 
for openSUSE:Factory checked in at 2019-09-27 14:54:10
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-DBIx-Class-DeploymentHandler (Old)
 and      
/work/SRC/openSUSE:Factory/.perl-DBIx-Class-DeploymentHandler.new.2352 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "perl-DBIx-Class-DeploymentHandler"

Fri Sep 27 14:54:10 2019 rev:12 rq:733631 version:0.002233

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/perl-DBIx-Class-DeploymentHandler/perl-DBIx-Class-DeploymentHandler.changes
      2019-06-12 13:12:57.288901261 +0200
+++ 
/work/SRC/openSUSE:Factory/.perl-DBIx-Class-DeploymentHandler.new.2352/perl-DBIx-Class-DeploymentHandler.changes
    2019-09-27 14:55:12.659709669 +0200
@@ -1,0 +2,13 @@
+Thu Sep 26 08:19:35 UTC 2019 -  <[email protected]>
+
+- updated to 0.002233
+   see /usr/share/doc/packages/perl-DBIx-Class-DeploymentHandler/Changes
+
+  0.002233  2019-09-25 13:32:11-04:00 America/New_York
+   - Add txn_wrap attribute to DBIC::DeploymentHandler
+   - Bugfix: Do not remove "false" transactions in deploy()
+   - use SQL::SplitStatement to split SQL statements in DDLs
+   - Add txn_prep attribute to keep backwards-compatibility
+   - Fixes GH #47, #68, #72 - thanks @augenslat
+
+-------------------------------------------------------------------

Old:
----
  DBIx-Class-DeploymentHandler-0.002232.tar.gz

New:
----
  DBIx-Class-DeploymentHandler-0.002233.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ perl-DBIx-Class-DeploymentHandler.spec ++++++
--- /var/tmp/diff_new_pack.HHxZtK/_old  2019-09-27 14:55:13.979706236 +0200
+++ /var/tmp/diff_new_pack.HHxZtK/_new  2019-09-27 14:55:13.983706225 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           perl-DBIx-Class-DeploymentHandler
-Version:        0.002232
+Version:        0.002233
 Release:        0
 %define cpan_name DBIx-Class-DeploymentHandler
 Summary:        Extensible DBIx::Class deployment
@@ -39,6 +39,7 @@
 BuildRequires:  perl(Moose) >= 1
 BuildRequires:  perl(MooseX::Role::Parameterized) >= 0.18
 BuildRequires:  perl(Path::Class) >= 0.26
+BuildRequires:  perl(SQL::SplitStatement) >= 1.00020
 BuildRequires:  perl(SQL::Translator) >= 0.11005
 BuildRequires:  perl(Sub::Exporter::Progressive)
 BuildRequires:  perl(Test::Fatal) >= 0.006
@@ -59,6 +60,7 @@
 Requires:       perl(Moose) >= 1
 Requires:       perl(MooseX::Role::Parameterized) >= 0.18
 Requires:       perl(Path::Class) >= 0.26
+Requires:       perl(SQL::SplitStatement) >= 1.00020
 Requires:       perl(SQL::Translator) >= 0.11005
 Requires:       perl(Sub::Exporter::Progressive)
 Requires:       perl(Text::Brew) >= 0.02

++++++ DBIx-Class-DeploymentHandler-0.002232.tar.gz -> 
DBIx-Class-DeploymentHandler-0.002233.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/DBIx-Class-DeploymentHandler-0.002232/Changes 
new/DBIx-Class-DeploymentHandler-0.002233/Changes
--- old/DBIx-Class-DeploymentHandler-0.002232/Changes   2019-06-07 
03:49:31.000000000 +0200
+++ new/DBIx-Class-DeploymentHandler-0.002233/Changes   2019-09-25 
19:32:25.000000000 +0200
@@ -1,5 +1,12 @@
 Revision history for DBIx-Class-DeploymentHandler
 
+0.002233  2019-09-25 13:32:11-04:00 America/New_York
+ - Add txn_wrap attribute to DBIC::DeploymentHandler
+ - Bugfix: Do not remove "false" transactions in deploy()
+ - use SQL::SplitStatement to split SQL statements in DDLs
+ - Add txn_prep attribute to keep backwards-compatibility
+ - Fixes GH #47, #68, #72 - thanks @augenslat
+
 0.002232  2019-06-06 21:49:17-04:00 America/New_York
  - Add missing dependency on YAML.pm
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/DBIx-Class-DeploymentHandler-0.002232/MANIFEST 
new/DBIx-Class-DeploymentHandler-0.002233/MANIFEST
--- old/DBIx-Class-DeploymentHandler-0.002232/MANIFEST  2019-06-07 
03:49:31.000000000 +0200
+++ new/DBIx-Class-DeploymentHandler-0.002233/MANIFEST  2019-09-25 
19:32:25.000000000 +0200
@@ -1,4 +1,4 @@
-# This file was automatically generated by Dist::Zilla::Plugin::Manifest 
v6.010.
+# This file was automatically generated by Dist::Zilla::Plugin::Manifest 
v6.012.
 Changes
 LICENSE
 MANIFEST
@@ -39,6 +39,7 @@
 lib/DBIx/Class/DeploymentHandler/WithReasonableDefaults.pm
 t/00-report-prereqs.t
 t/02-instantiation-alt-result-class.t
+t/02-instantiation-no-ddl-no-wrap.t
 t/02-instantiation-no-ddl.t
 t/02-instantiation-wo-component.t
 t/02-instantiation.t
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/DBIx-Class-DeploymentHandler-0.002232/META.json 
new/DBIx-Class-DeploymentHandler-0.002233/META.json
--- old/DBIx-Class-DeploymentHandler-0.002232/META.json 2019-06-07 
03:49:31.000000000 +0200
+++ new/DBIx-Class-DeploymentHandler-0.002233/META.json 2019-09-25 
19:32:25.000000000 +0200
@@ -4,7 +4,7 @@
       "Arthur Axel \"fREW\" Schmidt <[email protected]>"
    ],
    "dynamic_config" : 0,
-   "generated_by" : "Dist::Zilla version 6.010, CPAN::Meta::Converter version 
2.150010",
+   "generated_by" : "Dist::Zilla version 6.012, CPAN::Meta::Converter version 
2.150010",
    "license" : [
       "perl_5"
    ],
@@ -35,6 +35,7 @@
             "Moose" : "1",
             "MooseX::Role::Parameterized" : "0.18",
             "Path::Class" : "0.26",
+            "SQL::SplitStatement" : "1.00020",
             "SQL::Translator" : "0.11005",
             "Sub::Exporter::Progressive" : "0",
             "Text::Brew" : "0.02",
@@ -71,7 +72,8 @@
          "web" : "https://github.com/frioux/DBIx-Class-DeploymentHandler";
       }
    },
-   "version" : "0.002232",
-   "x_serialization_backend" : "Cpanel::JSON::XS version 3.0239"
+   "version" : "0.002233",
+   "x_generated_by_perl" : "v5.28.2",
+   "x_serialization_backend" : "Cpanel::JSON::XS version 4.11"
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/DBIx-Class-DeploymentHandler-0.002232/META.yml 
new/DBIx-Class-DeploymentHandler-0.002233/META.yml
--- old/DBIx-Class-DeploymentHandler-0.002232/META.yml  2019-06-07 
03:49:31.000000000 +0200
+++ new/DBIx-Class-DeploymentHandler-0.002233/META.yml  2019-09-25 
19:32:25.000000000 +0200
@@ -12,7 +12,7 @@
 configure_requires:
   ExtUtils::MakeMaker: '0'
 dynamic_config: 0
-generated_by: 'Dist::Zilla version 6.010, CPAN::Meta::Converter version 
2.150010'
+generated_by: 'Dist::Zilla version 6.012, CPAN::Meta::Converter version 
2.150010'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -28,6 +28,7 @@
   Moose: '1'
   MooseX::Role::Parameterized: '0.18'
   Path::Class: '0.26'
+  SQL::SplitStatement: '1.00020'
   SQL::Translator: '0.11005'
   Sub::Exporter::Progressive: '0'
   Text::Brew: '0.02'
@@ -40,5 +41,6 @@
   bugtracker: https://github.com/frioux/DBIx-Class-DeploymentHandler/issues
   homepage: https://github.com/frioux/DBIx-Class-DeploymentHandler
   repository: https://github.com/frioux/DBIx-Class-DeploymentHandler.git
-version: '0.002232'
-x_serialization_backend: 'YAML::Tiny version 1.70'
+version: '0.002233'
+x_generated_by_perl: v5.28.2
+x_serialization_backend: 'YAML::Tiny version 1.73'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/DBIx-Class-DeploymentHandler-0.002232/Makefile.PL 
new/DBIx-Class-DeploymentHandler-0.002233/Makefile.PL
--- old/DBIx-Class-DeploymentHandler-0.002232/Makefile.PL       2019-06-07 
03:49:31.000000000 +0200
+++ new/DBIx-Class-DeploymentHandler-0.002233/Makefile.PL       2019-09-25 
19:32:25.000000000 +0200
@@ -1,4 +1,4 @@
-# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker 
v6.010.
+# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker 
v6.012.
 use strict;
 use warnings;
 
@@ -25,6 +25,7 @@
     "Moose" => 1,
     "MooseX::Role::Parameterized" => "0.18",
     "Path::Class" => "0.26",
+    "SQL::SplitStatement" => "1.00020",
     "SQL::Translator" => "0.11005",
     "Sub::Exporter::Progressive" => 0,
     "Text::Brew" => "0.02",
@@ -42,7 +43,7 @@
     "Test::Requires" => "0.06",
     "aliased" => 0
   },
-  "VERSION" => "0.002232",
+  "VERSION" => "0.002233",
   "test" => {
     "TESTS" => "t/*.t t/bugs/*.t t/deploy_methods/*.t t/version_handlers/*.t 
t/version_storages/*.t"
   }
@@ -61,6 +62,7 @@
   "Moose" => 1,
   "MooseX::Role::Parameterized" => "0.18",
   "Path::Class" => "0.26",
+  "SQL::SplitStatement" => "1.00020",
   "SQL::Translator" => "0.11005",
   "Sub::Exporter::Progressive" => 0,
   "Test::Fatal" => "0.006",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/DBIx-Class-DeploymentHandler-0.002232/README 
new/DBIx-Class-DeploymentHandler-0.002233/README
--- old/DBIx-Class-DeploymentHandler-0.002232/README    2019-06-07 
03:49:31.000000000 +0200
+++ new/DBIx-Class-DeploymentHandler-0.002233/README    2019-09-25 
19:32:25.000000000 +0200
@@ -63,6 +63,49 @@
     That's really just a taste of some of the differences. Check out each
     role for all the details.
 
+ATTRIBUTES
+    This is just a "stub" section to make clear that the bulk of
+    implementation is documented somewhere else.
+
+  Attributes passed to DBIx::Class::DeploymentHandler::HandlesDeploy
+    *   "ignore_ddl" in
+        DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator
+
+    *   "databases" in
+        DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator
+
+    *   "script_directory" in
+        DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator
+
+    *   "sql_translator_args" in
+        DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator
+
+    *   "force_overwrite" in
+        DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator
+
+    *   "txn_prep" in
+        DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator
+
+    *   "txn_wrap" in
+        DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator
+
+  Attributes passed to DBIx::Class::DeploymentHandler::HandlesVersioning
+    *   initial_version
+
+    *   "schema_version" in DBIx::Class::DeploymentHandler::Dad
+
+    *   "to_version" in DBIx::Class::DeploymentHandler::Dad
+
+  Attributes passed to DBIx::Class::DeploymentHandler::HandlesVersionStorage
+    *   version_source
+
+    *   version_class
+
+  Attributes Inherited from Parent Class
+    See "ATTRIBUTES" in DBIx::Class::DeploymentHandler::Dad and "ORTHODOX
+    METHODS" in DBIx::Class::DeploymentHandler::Dad for the remaining
+    available attributes to pass to "new".
+
 WHERE IS ALL THE DOC?!
     To get up and running fast, your best place to start is
     DBIx::Class::DeploymentHandler::Manual::Intro and then
@@ -180,8 +223,8 @@
     implementation is documented in DBIx::Class::DeploymentHandler::Dad.
     Since that is implemented using Moose class, see "ATTRIBUTES" in
     DBIx::Class::DeploymentHandler::Dad and "ORTHODOX METHODS" in
-    DBIx::Class::DeploymentHandler::Dad for available attributes to pass to
-    "new", and methods callable on the resulting object.
+    DBIx::Class::DeploymentHandler::Dad for methods callable on the
+    resulting object.
 
   new
       my $s = My::Schema->connect(...);
@@ -191,10 +234,6 @@
         sql_translator_args => { add_drop_table => 0 },
       });
 
-    See "ATTRIBUTES" in DBIx::Class::DeploymentHandler::Dad and "ORTHODOX
-    METHODS" in DBIx::Class::DeploymentHandler::Dad for available attributes
-    to pass to "new".
-
   prepare_version_storage_install
      $dh->prepare_version_storage_install
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/DBIx-Class-DeploymentHandler-0.002232/cpanfile 
new/DBIx-Class-DeploymentHandler-0.002233/cpanfile
--- old/DBIx-Class-DeploymentHandler-0.002232/cpanfile  2019-06-07 
03:49:31.000000000 +0200
+++ new/DBIx-Class-DeploymentHandler-0.002233/cpanfile  2019-09-25 
19:32:25.000000000 +0200
@@ -15,6 +15,7 @@
 requires 'Sub::Exporter::Progressive' => 0;
 requires 'Text::Brew' => 0.02;
 requires 'YAML' => 0.66;
+requires 'SQL::SplitStatement' => '1.00020';
 
 on test => sub {
    requires 'Test::More' => 0.88;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/DBIx-Class-DeploymentHandler-0.002232/dist.ini 
new/DBIx-Class-DeploymentHandler-0.002233/dist.ini
--- old/DBIx-Class-DeploymentHandler-0.002232/dist.ini  2019-06-07 
03:49:31.000000000 +0200
+++ new/DBIx-Class-DeploymentHandler-0.002233/dist.ini  2019-09-25 
19:32:25.000000000 +0200
@@ -2,7 +2,7 @@
 author           = Arthur Axel "fREW" Schmidt <[email protected]>
 license          = Perl_5
 copyright_holder = Arthur Axel "fREW" Schmidt
-version          = 0.002232
+version          = 0.002233
 
 ; authordep Pod::Weaver::Plugin::Ditaa
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/Dad.pm
 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/Dad.pm
--- 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/Dad.pm
   2019-06-07 03:49:31.000000000 +0200
+++ 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/Dad.pm
   2019-09-25 19:32:25.000000000 +0200
@@ -1,5 +1,5 @@
 package DBIx::Class::DeploymentHandler::Dad;
-$DBIx::Class::DeploymentHandler::Dad::VERSION = '0.002232';
+$DBIx::Class::DeploymentHandler::Dad::VERSION = '0.002233';
 # ABSTRACT: Parent class for DeploymentHandlers
 
 use Moose;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/DeployMethod/SQL/Translator/Deprecated.pm
 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/DeployMethod/SQL/Translator/Deprecated.pm
--- 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/DeployMethod/SQL/Translator/Deprecated.pm
        2019-06-07 03:49:31.000000000 +0200
+++ 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/DeployMethod/SQL/Translator/Deprecated.pm
        2019-09-25 19:32:25.000000000 +0200
@@ -1,5 +1,5 @@
 package 
DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator::Deprecated;
-$DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator::Deprecated::VERSION
 = '0.002232';
+$DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator::Deprecated::VERSION
 = '0.002233';
 use Moose;
 
 # ABSTRACT: (DEPRECATED) Use this if you are stuck in the past
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/DeployMethod/SQL/Translator/ScriptHelpers.pm
 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/DeployMethod/SQL/Translator/ScriptHelpers.pm
--- 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/DeployMethod/SQL/Translator/ScriptHelpers.pm
     2019-06-07 03:49:31.000000000 +0200
+++ 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/DeployMethod/SQL/Translator/ScriptHelpers.pm
     2019-09-25 19:32:25.000000000 +0200
@@ -1,5 +1,5 @@
 package 
DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator::ScriptHelpers;
-$DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator::ScriptHelpers::VERSION
 = '0.002232';
+$DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator::ScriptHelpers::VERSION
 = '0.002233';
 # ABSTRACT: CodeRef Transforms for common use-cases in DBICDH Migrations
 
 use strict;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/DeployMethod/SQL/Translator.pm
 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/DeployMethod/SQL/Translator.pm
--- 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/DeployMethod/SQL/Translator.pm
   2019-06-07 03:49:31.000000000 +0200
+++ 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/DeployMethod/SQL/Translator.pm
   2019-09-25 19:32:25.000000000 +0200
@@ -1,5 +1,5 @@
 package DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator;
-$DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator::VERSION = 
'0.002232';
+$DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator::VERSION = 
'0.002233';
 use Moose;
 
 # ABSTRACT: Manage your SQL and Perl migrations in nicely laid out directories
@@ -12,6 +12,7 @@
 
 use Try::Tiny;
 
+use SQL::SplitStatement '1.00020';
 use SQL::Translator;
 require SQL::Translator::Diff;
 
@@ -76,6 +77,12 @@
   default => sub { [qw( MySQL SQLite PostgreSQL )] },
 );
 
+has txn_prep => (
+  isa      => 'Bool',
+  is       => 'ro',
+  default  => 1,
+);
+
 has txn_wrap => (
   is => 'ro',
   isa => 'Bool',
@@ -95,6 +102,14 @@
   $self->schema->schema_version
 }
 
+has sql_splitter => (
+    is => 'ro',
+    lazy => 1,
+    builder => '_build_sql_splitter',
+);
+
+sub _build_sql_splitter { SQL::SplitStatement->new }
+
 sub __ddl_consume_with_prefix {
   my ($self, $type, $versions, $prefix) = @_;
   my $base_dir = $self->script_directory;
@@ -252,122 +267,40 @@
   return join "\n", @$sql
 }
 
-my %STORAGE2FEATURE = (
-  SQLServer => {
-    txn => qr/begin\s+transaction\b/i,
-    comment => {
-      DD => 1, # --
-      HASH => 1,
-      SSTAR => 1, # /* */
-      DS => 1, # //
-      PERCENT => 1,
-    },
-  },
-  Sybase => {
-    txn => qr/begin\s+transaction\b/i,
-    comment => {
-      DD => 1,
-      SSTAR => 1,
-      DS => 1,
-      PERCENT => 1,
-    },
-  },
-  SQLite => {
-    txn => qr/begin\b/i,
-    comment => {
-      DD => 1,
-      HASH => 1,
-    },
-  },
-  MySQL => {
-    txn => qr/(begin\b|start\s+transaction\b)/i,
-    comment => {
-      DD => 1,
-      HASH => 1,
-      SS => 1,
-    },
-  },
-  Oracle => {
-    comment => {
-      DD => 1,
-      HASH => 1,
-      SS => 1,
-    },
-  },
-  Pg => {
-    txn => qr/begin\b/i,
-    chunk => sub {
-      my ($c) = @_;
-      my @ret;
-      my $accumulator = '';
-      while (length $c) {
-        if ($c =~ s/\A([^\$]*?);//s) {
-          $accumulator .= $1;
-          push @ret, $accumulator;
-          $accumulator = '';
-        } elsif (
-          $c =~ s/\A(
-            .*?
-            ( \$ [^\$]* \$ )
-          )//xs
-        ) {
-          # got a $...$ .. $...$ chunk
-          $accumulator .= $1;
-          my $anchor = $2;
-          $c =~ s/\A(
-            .*?
-            \Q$anchor\E
-          )//xs;
-          $accumulator .= $1;
-        } elsif ($c =~ s/\A\s*\z//s) {
-          push @ret, $accumulator;
-          $accumulator = '';
-        } else {
-          push @ret, $accumulator.$c;
-          $accumulator = '';
-          last;
-        }
-      }
-      @ret;
-    },
-    comment => {
-      DD => 1,
-      HASH => 1,
-    },
-  },
+my %TXN = (
+  SQLServer => qr/(BEGIN\s+TRANSACTION\b|COMMIT\b)/i,
+  Sybase    => qr/(BEGIN\s+TRANSACTION\b|COMMIT\b)/i,
+  SQLite    => qr/(BEGIN\b|COMMIT\b)/i,
+  mysql     => qr/(BEGIN\b|START\s+TRANSACTION\b|COMMIT\b)/i,
+  Oracle    => qr/COMMIT\b/i,
+  Pg        => qr/(BEGIN\b|COMMIT\b)/i,
 );
 
-# split a chunk o' SQL into statements
 sub _split_sql_chunk {
   my $self = shift;
-  my @sql = map { $_.'' } @_; # copy
-  my $storage_class = ref $self->storage;
-  $storage_class =~ s/.*://;
-  my $feature = $STORAGE2FEATURE{$storage_class} || $STORAGE2FEATURE{MySQL};
-  for ( @sql ) {
-    # strip transactions
-    my $txn = $feature->{txn};
-    s/^\s*($txn|COMMIT\b).*//mgi if $txn;
-    # remove comments
-    my $comment = $feature->{comment};
-    s{--.*}{}gm if $comment->{DD};
-    s{/\* .*? \*/}{}xs if $comment->{SS};
-    s{//.*}{}gm if $comment->{DS};
-    s{#.*}{}gm if $comment->{HASH};
-    s{%.*}{}gm if $comment->{PERCENT};
-  }
-  my $chunk = $feature->{chunk} || sub { split /;\n/, $_[0] };
-  @sql = map $chunk->($_), @sql;
+  my ($storage_class) = ref($self->storage) =~ /.*:(\w+)$/;
+  my $txn = $TXN{$storage_class} || $TXN{mysql};
+
+  # MySQL's DELIMITER is not understood by the server but handled on the 
client.
+  # SQL::SplitStatement treats the statements between the DELIMITERs correctly
+  # as ONE statement - but it does not remove the DELIMITER lines.
+  # https://rt.cpan.org/Public/Bug/Display.html?id=130473
+  # Transaction statements should not be present if txn_prep is false, if it
+  # is true then anything that looks like a transaction is removed here.
+  my @sql =
+    grep {
+      ($storage_class ne 'mysql' || /^(?!DELIMITER\s+)/i) &&
+      (!$self->txn_prep || /^(?!$txn)/gim)
+    }
+    map {
+      $self->sql_splitter->split($_)
+    } @_;
+
   for ( @sql ) {
-    # trim whitespace
-    s/^\s+//gm;
-    s/\s+$//gm;
-    # remove blank lines
-    s/^\n//gm;
-    # put on single line
-    s/\n/ /g;
+    s/\s*\n+\s*/ /g;    # put on single line
   }
-  return grep $_, @sql;
+
+  return @sql;
 }
 
 sub _run_sql {
@@ -589,11 +522,27 @@
   );
   $_->($source_schema, $dest_schema) for @$transforms;
 
-  return [SQL::Translator::Diff::schema_diff(
-     $source_schema, $db,
-     $dest_schema,   $db,
-     { producer_args => $sqltargs }
-  )];
+  # SQL::Translator::Diff::schema_diff or rather the underlying
+  # SQL::Translator::Diff::produce_diff_sql has severe issues:
+  # 1. It is undocumented
+  # 2. It wraps the result in "BEGIN; ... COMMIT;" *SIGH*
+  # 3. In a first glance it seems it could also return undef in
+  #    list context, but the code is broken enough so that part
+  #    is never reached. *roll eyes*
+  my $i = 0;
+  my @stmts = SQL::Translator::Diff::schema_diff(
+    $source_schema, $db,
+    $dest_schema,   $db,
+    { producer_args => $sqltargs }
+  );
+
+  if (!$self->txn_prep && $self->txn_wrap) {
+    pop @stmts;                                         # remove final COMMIT
+    ++$i while $stmts[$i] =~ /^-- /;                    # skip leading comments
+    splice @stmts, $i, 1 if $stmts[$i] =~ /^BEGIN;/;    # remove first BEGIN;
+  }
+
+  return \@stmts;
 }
 
 sub _sql_from_yaml {
@@ -1161,10 +1110,26 @@
 The types of databases (default C<< [qw( MySQL SQLite PostgreSQL )] >>) to
 generate files for
 
+=head2 txn_prep
+
+This attribute will, when set to false (default is true), cause the DM to
+I<generate> SQL without enclosing C<BEGIN> and C<COMMIT> statements.
+
+The (current) default behavior is to create DDLs wrapped in transactions and
+to remove anything that looks like a transaction from the generated DDLs
+later I<when running the deployment>.
+
+Since this default behavior is error prone it is strictly recommended to set
+the C<txn_prep> attribute to false and remove all transaction statements from
+previously generated DDLs.
+
 =head2 txn_wrap
 
 Set to true (which is the default) to wrap all upgrades and deploys in a single
-transaction.
+transaction. This option should be false if the DDL files contain transaction
+statements.
+
+Keep in mind that not all DBMSes support transactions over DDL statements.
 
 =head2 schema_version
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/Deprecated.pm
 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/Deprecated.pm
--- 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/Deprecated.pm
    2019-06-07 03:49:31.000000000 +0200
+++ 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/Deprecated.pm
    2019-09-25 19:32:25.000000000 +0200
@@ -1,5 +1,5 @@
 package DBIx::Class::DeploymentHandler::Deprecated;
-$DBIx::Class::DeploymentHandler::Deprecated::VERSION = '0.002232';
+$DBIx::Class::DeploymentHandler::Deprecated::VERSION = '0.002233';
 # ABSTRACT: (DEPRECATED) Use this if you are stuck in the past
 
 use Moose;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/HandlesDeploy.pm
 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/HandlesDeploy.pm
--- 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/HandlesDeploy.pm
 2019-06-07 03:49:31.000000000 +0200
+++ 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/HandlesDeploy.pm
 2019-09-25 19:32:25.000000000 +0200
@@ -1,5 +1,5 @@
 package DBIx::Class::DeploymentHandler::HandlesDeploy;
-$DBIx::Class::DeploymentHandler::HandlesDeploy::VERSION = '0.002232';
+$DBIx::Class::DeploymentHandler::HandlesDeploy::VERSION = '0.002233';
 use Moose::Role;
 
 # ABSTRACT: Interface for deploy methods
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/HandlesVersionStorage.pm
 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/HandlesVersionStorage.pm
--- 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/HandlesVersionStorage.pm
 2019-06-07 03:49:31.000000000 +0200
+++ 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/HandlesVersionStorage.pm
 2019-09-25 19:32:25.000000000 +0200
@@ -1,5 +1,5 @@
 package DBIx::Class::DeploymentHandler::HandlesVersionStorage;
-$DBIx::Class::DeploymentHandler::HandlesVersionStorage::VERSION = '0.002232';
+$DBIx::Class::DeploymentHandler::HandlesVersionStorage::VERSION = '0.002233';
 use Moose::Role;
 
 # ABSTRACT: Interface for version storage methods
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/HandlesVersioning.pm
 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/HandlesVersioning.pm
--- 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/HandlesVersioning.pm
     2019-06-07 03:49:31.000000000 +0200
+++ 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/HandlesVersioning.pm
     2019-09-25 19:32:25.000000000 +0200
@@ -1,5 +1,5 @@
 package DBIx::Class::DeploymentHandler::HandlesVersioning;
-$DBIx::Class::DeploymentHandler::HandlesVersioning::VERSION = '0.002232';
+$DBIx::Class::DeploymentHandler::HandlesVersioning::VERSION = '0.002233';
 use Moose::Role;
 
 # ABSTRACT: Interface for version methods
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/LogImporter.pm
 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/LogImporter.pm
--- 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/LogImporter.pm
   2019-06-07 03:49:31.000000000 +0200
+++ 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/LogImporter.pm
   2019-09-25 19:32:25.000000000 +0200
@@ -1,5 +1,5 @@
 package DBIx::Class::DeploymentHandler::LogImporter;
-$DBIx::Class::DeploymentHandler::LogImporter::VERSION = '0.002232';
+$DBIx::Class::DeploymentHandler::LogImporter::VERSION = '0.002233';
 use warnings;
 use strict;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/LogRouter.pm
 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/LogRouter.pm
--- 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/LogRouter.pm
     2019-06-07 03:49:31.000000000 +0200
+++ 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/LogRouter.pm
     2019-09-25 19:32:25.000000000 +0200
@@ -1,5 +1,5 @@
 package DBIx::Class::DeploymentHandler::LogRouter;
-$DBIx::Class::DeploymentHandler::LogRouter::VERSION = '0.002232';
+$DBIx::Class::DeploymentHandler::LogRouter::VERSION = '0.002233';
 use Moo;
 use DBIx::Class::DeploymentHandler::Logger;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/Logger.pm
 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/Logger.pm
--- 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/Logger.pm
        2019-06-07 03:49:31.000000000 +0200
+++ 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/Logger.pm
        2019-09-25 19:32:25.000000000 +0200
@@ -1,5 +1,5 @@
 package DBIx::Class::DeploymentHandler::Logger;
-$DBIx::Class::DeploymentHandler::Logger::VERSION = '0.002232';
+$DBIx::Class::DeploymentHandler::Logger::VERSION = '0.002233';
 use warnings;
 use strict;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/Types.pm
 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/Types.pm
--- 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/Types.pm
 2019-06-07 03:49:31.000000000 +0200
+++ 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/Types.pm
 2019-09-25 19:32:25.000000000 +0200
@@ -1,5 +1,5 @@
 package DBIx::Class::DeploymentHandler::Types;
-$DBIx::Class::DeploymentHandler::Types::VERSION = '0.002232';
+$DBIx::Class::DeploymentHandler::Types::VERSION = '0.002233';
 use strict;
 use warnings;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/VersionHandler/DatabaseToSchemaVersions.pm
 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/VersionHandler/DatabaseToSchemaVersions.pm
--- 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/VersionHandler/DatabaseToSchemaVersions.pm
       2019-06-07 03:49:31.000000000 +0200
+++ 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/VersionHandler/DatabaseToSchemaVersions.pm
       2019-09-25 19:32:25.000000000 +0200
@@ -1,5 +1,5 @@
 package 
DBIx::Class::DeploymentHandler::VersionHandler::DatabaseToSchemaVersions;
-$DBIx::Class::DeploymentHandler::VersionHandler::DatabaseToSchemaVersions::VERSION
 = '0.002232';
+$DBIx::Class::DeploymentHandler::VersionHandler::DatabaseToSchemaVersions::VERSION
 = '0.002233';
 use Moose;
 
 # ABSTRACT: Go straight from Database to Schema version
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/VersionHandler/ExplicitVersions.pm
 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/VersionHandler/ExplicitVersions.pm
--- 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/VersionHandler/ExplicitVersions.pm
       2019-06-07 03:49:31.000000000 +0200
+++ 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/VersionHandler/ExplicitVersions.pm
       2019-09-25 19:32:25.000000000 +0200
@@ -1,5 +1,5 @@
 package DBIx::Class::DeploymentHandler::VersionHandler::ExplicitVersions;
-$DBIx::Class::DeploymentHandler::VersionHandler::ExplicitVersions::VERSION = 
'0.002232';
+$DBIx::Class::DeploymentHandler::VersionHandler::ExplicitVersions::VERSION = 
'0.002233';
 use Moose;
 
 # ABSTRACT: Define your own list of versions to use for migrations
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/VersionHandler/Monotonic.pm
 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/VersionHandler/Monotonic.pm
--- 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/VersionHandler/Monotonic.pm
      2019-06-07 03:49:31.000000000 +0200
+++ 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/VersionHandler/Monotonic.pm
      2019-09-25 19:32:25.000000000 +0200
@@ -1,5 +1,5 @@
 package DBIx::Class::DeploymentHandler::VersionHandler::Monotonic;
-$DBIx::Class::DeploymentHandler::VersionHandler::Monotonic::VERSION = 
'0.002232';
+$DBIx::Class::DeploymentHandler::VersionHandler::Monotonic::VERSION = 
'0.002233';
 use Moose;
 use DBIx::Class::DeploymentHandler::Types;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/VersionStorage/Deprecated/Component.pm
 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/VersionStorage/Deprecated/Component.pm
--- 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/VersionStorage/Deprecated/Component.pm
   2019-06-07 03:49:31.000000000 +0200
+++ 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/VersionStorage/Deprecated/Component.pm
   2019-09-25 19:32:25.000000000 +0200
@@ -1,5 +1,5 @@
 package DBIx::Class::DeploymentHandler::VersionStorage::Deprecated::Component;
-$DBIx::Class::DeploymentHandler::VersionStorage::Deprecated::Component::VERSION
 = '0.002232';
+$DBIx::Class::DeploymentHandler::VersionStorage::Deprecated::Component::VERSION
 = '0.002233';
 # ABSTRACT: (DEPRECATED) Attach this component to your schema to ensure you 
stay up to date
 
 use strict;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/VersionStorage/Deprecated/VersionResult.pm
 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/VersionStorage/Deprecated/VersionResult.pm
--- 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/VersionStorage/Deprecated/VersionResult.pm
       2019-06-07 03:49:31.000000000 +0200
+++ 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/VersionStorage/Deprecated/VersionResult.pm
       2019-09-25 19:32:25.000000000 +0200
@@ -1,5 +1,5 @@
 package 
DBIx::Class::DeploymentHandler::VersionStorage::Deprecated::VersionResult;
-$DBIx::Class::DeploymentHandler::VersionStorage::Deprecated::VersionResult::VERSION
 = '0.002232';
+$DBIx::Class::DeploymentHandler::VersionStorage::Deprecated::VersionResult::VERSION
 = '0.002233';
 # ABSTRACT: (DEPRECATED) The old way to store versions in the database
 
 use strict;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/VersionStorage/Deprecated/VersionResultSet.pm
 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/VersionStorage/Deprecated/VersionResultSet.pm
--- 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/VersionStorage/Deprecated/VersionResultSet.pm
    2019-06-07 03:49:31.000000000 +0200
+++ 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/VersionStorage/Deprecated/VersionResultSet.pm
    2019-09-25 19:32:25.000000000 +0200
@@ -1,5 +1,5 @@
 package 
DBIx::Class::DeploymentHandler::VersionStorage::Deprecated::VersionResultSet;
-$DBIx::Class::DeploymentHandler::VersionStorage::Deprecated::VersionResultSet::VERSION
 = '0.002232';
+$DBIx::Class::DeploymentHandler::VersionStorage::Deprecated::VersionResultSet::VERSION
 = '0.002233';
 # ABSTRACT: (DEPRECATED) Predefined searches to find what you want from the 
version storage
 
 use strict;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/VersionStorage/Deprecated.pm
 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/VersionStorage/Deprecated.pm
--- 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/VersionStorage/Deprecated.pm
     2019-06-07 03:49:31.000000000 +0200
+++ 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/VersionStorage/Deprecated.pm
     2019-09-25 19:32:25.000000000 +0200
@@ -1,5 +1,5 @@
 package DBIx::Class::DeploymentHandler::VersionStorage::Deprecated;
-$DBIx::Class::DeploymentHandler::VersionStorage::Deprecated::VERSION = 
'0.002232';
+$DBIx::Class::DeploymentHandler::VersionStorage::Deprecated::VERSION = 
'0.002233';
 use Moose;
 use DBIx::Class::DeploymentHandler::LogImporter ':log';
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/VersionStorage/Standard/Component.pm
 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/VersionStorage/Standard/Component.pm
--- 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/VersionStorage/Standard/Component.pm
     2019-06-07 03:49:31.000000000 +0200
+++ 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/VersionStorage/Standard/Component.pm
     2019-09-25 19:32:25.000000000 +0200
@@ -1,5 +1,5 @@
 package DBIx::Class::DeploymentHandler::VersionStorage::Standard::Component;
-$DBIx::Class::DeploymentHandler::VersionStorage::Standard::Component::VERSION 
= '0.002232';
+$DBIx::Class::DeploymentHandler::VersionStorage::Standard::Component::VERSION 
= '0.002233';
 # ABSTRACT: Attach this component to your schema to ensure you stay up to date
 
 use strict;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/VersionStorage/Standard/VersionResult.pm
 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/VersionStorage/Standard/VersionResult.pm
--- 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/VersionStorage/Standard/VersionResult.pm
 2019-06-07 03:49:31.000000000 +0200
+++ 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/VersionStorage/Standard/VersionResult.pm
 2019-09-25 19:32:25.000000000 +0200
@@ -1,5 +1,5 @@
 package 
DBIx::Class::DeploymentHandler::VersionStorage::Standard::VersionResult;
-$DBIx::Class::DeploymentHandler::VersionStorage::Standard::VersionResult::VERSION
 = '0.002232';
+$DBIx::Class::DeploymentHandler::VersionStorage::Standard::VersionResult::VERSION
 = '0.002233';
 # ABSTRACT: The typical way to store versions in the database
 
 use strict;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/VersionStorage/Standard/VersionResultSet.pm
 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/VersionStorage/Standard/VersionResultSet.pm
--- 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/VersionStorage/Standard/VersionResultSet.pm
      2019-06-07 03:49:31.000000000 +0200
+++ 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/VersionStorage/Standard/VersionResultSet.pm
      2019-09-25 19:32:25.000000000 +0200
@@ -1,5 +1,5 @@
 package 
DBIx::Class::DeploymentHandler::VersionStorage::Standard::VersionResultSet;
-$DBIx::Class::DeploymentHandler::VersionStorage::Standard::VersionResultSet::VERSION
 = '0.002232';
+$DBIx::Class::DeploymentHandler::VersionStorage::Standard::VersionResultSet::VERSION
 = '0.002233';
 # ABSTRACT: Predefined searches to find what you want from the version storage
 
 use strict;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/VersionStorage/Standard.pm
 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/VersionStorage/Standard.pm
--- 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/VersionStorage/Standard.pm
       2019-06-07 03:49:31.000000000 +0200
+++ 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/VersionStorage/Standard.pm
       2019-09-25 19:32:25.000000000 +0200
@@ -1,5 +1,5 @@
 package DBIx::Class::DeploymentHandler::VersionStorage::Standard;
-$DBIx::Class::DeploymentHandler::VersionStorage::Standard::VERSION = 
'0.002232';
+$DBIx::Class::DeploymentHandler::VersionStorage::Standard::VERSION = 
'0.002233';
 use Moose;
 use DBIx::Class::DeploymentHandler::LogImporter ':log';
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/WithApplicatorDumple.pm
 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/WithApplicatorDumple.pm
--- 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/WithApplicatorDumple.pm
  2019-06-07 03:49:31.000000000 +0200
+++ 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/WithApplicatorDumple.pm
  2019-09-25 19:32:25.000000000 +0200
@@ -1,5 +1,5 @@
 package DBIx::Class::DeploymentHandler::WithApplicatorDumple;
-$DBIx::Class::DeploymentHandler::WithApplicatorDumple::VERSION = '0.002232';
+$DBIx::Class::DeploymentHandler::WithApplicatorDumple::VERSION = '0.002233';
 use MooseX::Role::Parameterized;
 use Module::Runtime 'use_module';
 use namespace::autoclean;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/WithReasonableDefaults.pm
 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/WithReasonableDefaults.pm
--- 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler/WithReasonableDefaults.pm
        2019-06-07 03:49:31.000000000 +0200
+++ 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler/WithReasonableDefaults.pm
        2019-09-25 19:32:25.000000000 +0200
@@ -1,5 +1,5 @@
 package DBIx::Class::DeploymentHandler::WithReasonableDefaults;
-$DBIx::Class::DeploymentHandler::WithReasonableDefaults::VERSION = '0.002232';
+$DBIx::Class::DeploymentHandler::WithReasonableDefaults::VERSION = '0.002233';
 use Moose::Role;
 
 # ABSTRACT: Make default arguments to a few methods sensible
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler.pm 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler.pm
--- 
old/DBIx-Class-DeploymentHandler-0.002232/lib/DBIx/Class/DeploymentHandler.pm   
    2019-06-07 03:49:31.000000000 +0200
+++ 
new/DBIx-Class-DeploymentHandler-0.002233/lib/DBIx/Class/DeploymentHandler.pm   
    2019-09-25 19:32:25.000000000 +0200
@@ -1,5 +1,5 @@
 package DBIx::Class::DeploymentHandler;
-$DBIx::Class::DeploymentHandler::VERSION = '0.002232';
+$DBIx::Class::DeploymentHandler::VERSION = '0.002233';
 # ABSTRACT: Extensible DBIx::Class deployment
 
 use Moose;
@@ -16,7 +16,7 @@
     delegate_name        => 'deploy_method',
     attributes_to_assume => [qw(schema schema_version version_source)],
     attributes_to_copy   => [qw(
-      ignore_ddl databases script_directory sql_translator_args force_overwrite
+      ignore_ddl databases script_directory sql_translator_args 
force_overwrite txn_prep txn_wrap
     )],
   },
   'DBIx::Class::DeploymentHandler::WithApplicatorDumple' => {
@@ -152,6 +152,83 @@
 That's really just a taste of some of the differences.  Check out each role for
 all the details.
 
+=head1 ATTRIBUTES
+
+This is just a "stub" section to make clear
+that the bulk of implementation is documented somewhere else.
+
+=head2 Attributes passed to L<DBIx::Class::DeploymentHandler::HandlesDeploy>
+
+=over
+
+=item *
+
+L<DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator/ignore_ddl>
+
+=item *
+
+L<DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator/databases>
+
+=item *
+
+L<DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator/script_directory>
+
+=item *
+
+L<DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator/sql_translator_args>
+
+=item *
+
+L<DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator/force_overwrite>
+
+=item *
+
+L<DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator/txn_prep>
+
+=item *
+
+L<DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator/txn_wrap>
+
+=back
+
+=head2 Attributes passed to 
L<DBIx::Class::DeploymentHandler::HandlesVersioning>
+
+=over
+
+=item *
+
+initial_version
+
+=item *
+
+L<DBIx::Class::DeploymentHandler::Dad/schema_version>
+
+=item *
+
+L<DBIx::Class::DeploymentHandler::Dad/to_version>
+
+=back
+
+=head2 Attributes passed to 
L<DBIx::Class::DeploymentHandler::HandlesVersionStorage>
+
+=over
+
+=item *
+
+version_source
+
+=item *
+
+version_class
+
+=back
+
+=head2 Attributes Inherited from Parent Class
+
+See L<DBIx::Class::DeploymentHandler::Dad/ATTRIBUTES> and
+L<DBIx::Class::DeploymentHandler::Dad/"ORTHODOX METHODS"> for the remaining
+available attributes to pass to C<new>.
+
 =head1 WHERE IS ALL THE DOC?!
 
 To get up and running fast, your best place to start is
@@ -278,9 +355,8 @@
 that the bulk of implementation is documented in
 L<DBIx::Class::DeploymentHandler::Dad>. Since that is implemented using
 L<Moose> class, see L<DBIx::Class::DeploymentHandler::Dad/ATTRIBUTES>
-and L<DBIx::Class::DeploymentHandler::Dad/"ORTHODOX METHODS"> for
-available attributes to pass to C<new>, and methods callable on the
-resulting object.
+and L<DBIx::Class::DeploymentHandler::Dad/"ORTHODOX METHODS"> for methods
+callable on the resulting object.
 
 =head2 new
 
@@ -291,10 +367,6 @@
     sql_translator_args => { add_drop_table => 0 },
   });
 
-See L<DBIx::Class::DeploymentHandler::Dad/ATTRIBUTES> and
-L<DBIx::Class::DeploymentHandler::Dad/"ORTHODOX METHODS"> for available
-attributes to pass to C<new>.
-
 =head2 prepare_version_storage_install
 
  $dh->prepare_version_storage_install
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/DBIx-Class-DeploymentHandler-0.002232/t/02-instantiation-no-ddl-no-wrap.t 
new/DBIx-Class-DeploymentHandler-0.002233/t/02-instantiation-no-ddl-no-wrap.t
--- 
old/DBIx-Class-DeploymentHandler-0.002232/t/02-instantiation-no-ddl-no-wrap.t   
    1970-01-01 01:00:00.000000000 +0100
+++ 
new/DBIx-Class-DeploymentHandler-0.002233/t/02-instantiation-no-ddl-no-wrap.t   
    2019-09-25 19:32:25.000000000 +0200
@@ -0,0 +1,170 @@
+#!perl
+
+use strict;
+use warnings;
+
+use lib 't/lib';
+use DBICDHTest;
+use DBIx::Class::DeploymentHandler;
+use aliased 'DBIx::Class::DeploymentHandler', 'DH';
+
+use Test::More;
+use File::Temp 'tempdir';
+use Test::Fatal qw(lives_ok dies_ok);
+use DBI;
+
+my $dbh = DBICDHTest::dbh();
+my @connection = (sub { $dbh }, { ignore_version => 1 });
+my $sql_dir = tempdir( CLEANUP => 1 );
+
+VERSION1: {
+  use_ok 'DBICVersion_v1';
+  my $s = DBICVersion::Schema->connect(@connection);
+  $DBICVersion::Schema::VERSION = 1;
+  ok($s, 'DBICVersion::Schema 1 instantiates correctly');
+  my $handler = DH->new({
+    ignore_ddl => 1,
+    script_directory => $sql_dir,
+    schema => $s,
+    databases => [],
+    sql_translator_args => { add_drop_table => 0 },
+    txn_wrap => 0,
+  });
+
+  ok($handler, 'DBIx::Class::DeploymentHandler w/1 instantiates correctly');
+
+  my $version = $s->schema_version;
+  $handler->prepare_install;
+
+  dies_ok {
+    $s->resultset('Foo')->create({
+      bar => 'frew',
+    })
+  } 'schema not deployed';
+  $handler->install;
+  dies_ok {
+    $handler->install;
+  } 'cannot install twice';
+  lives_ok {
+    $s->resultset('Foo')->create({
+      bar => 'frew',
+    })
+  } 'schema is deployed';
+}
+
+VERSION2: {
+  use_ok 'DBICVersion_v2';
+  my $s = DBICVersion::Schema->connect(@connection);
+  $DBICVersion::Schema::VERSION = 2;
+  ok($s, 'DBICVersion::Schema 2 instantiates correctly');
+  my $handler = DH->new({
+    ignore_ddl => 1,
+    script_directory => $sql_dir,
+    schema => $s,
+    databases => [],
+    txn_wrap => 0,
+  });
+
+  ok($handler, 'DBIx::Class::DeploymentHandler w/2 instantiates correctly');
+
+  my $version = $s->schema_version();
+  $handler->prepare_install;
+  dies_ok {
+    $s->resultset('Foo')->create({
+      bar => 'frew',
+      baz => 'frew',
+    })
+  } 'schema not deployed';
+  dies_ok {
+    $s->resultset('Foo')->create({
+      bar => 'frew',
+      baz => 'frew',
+    })
+  } 'schema not uppgrayyed';
+  $handler->upgrade;
+  lives_ok {
+    $s->resultset('Foo')->create({
+      bar => 'frew',
+      baz => 'frew',
+    })
+  } 'schema is deployed';
+}
+
+VERSION3: {
+  use_ok 'DBICVersion_v3';
+  my $s = DBICVersion::Schema->connect(@connection);
+  $DBICVersion::Schema::VERSION = 3;
+  ok($s, 'DBICVersion::Schema 3 instantiates correctly');
+  my $handler = DH->new({
+    ignore_ddl => 1,
+    script_directory => $sql_dir,
+    schema => $s,
+    databases => [],
+    txn_wrap => 0,
+  });
+
+  ok($handler, 'DBIx::Class::DeploymentHandler w/3 instantiates correctly');
+
+  my $version = $s->schema_version();
+  $handler->prepare_install;
+  dies_ok {
+    $s->resultset('Foo')->create({
+        bar => 'frew',
+        baz => 'frew',
+        biff => 'frew',
+      })
+  } 'schema not deployed';
+  $handler->upgrade;
+  lives_ok {
+    $s->resultset('Foo')->create({
+      bar => 'frew',
+      baz => 'frew',
+      biff => 'frew',
+    })
+  } 'schema is deployed';
+}
+
+DOWN2: {
+  use_ok 'DBICVersion_v4';
+  my $s = DBICVersion::Schema->connect(@connection);
+  $DBICVersion::Schema::VERSION = 2;
+  ok($s, 'DBICVersion::Schema 2 instantiates correctly');
+  my $handler = DH->new({
+    ignore_ddl => 1,
+    script_directory => $sql_dir,
+    schema => $s,
+    databases => [],
+    txn_wrap => 0,
+  });
+
+  ok($handler, 'DBIx::Class::DeploymentHandler w/2 instantiates correctly');
+
+  my $version = $s->schema_version();
+  lives_ok {
+    $s->resultset('Foo')->create({
+      bar => 'frew',
+      baz => 'frew',
+      biff => 'frew',
+    })
+  } 'schema at version 3';
+  $handler->downgrade;
+  dies_ok {
+    $s->resultset('Foo')->create({
+      bar => 'frew',
+      baz => 'frew',
+      biff => 'frew',
+    })
+  } 'schema not at version 3';
+  lives_ok {
+    $s->resultset('Foo')->create({
+      bar => 'frew',
+      baz => 'frew',
+    })
+  } 'schema is at version 2';
+
+  is $handler->version_storage->database_version => 2,
+    'database version is down to 2';
+
+}
+
+done_testing;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/DBIx-Class-DeploymentHandler-0.002232/t/02-instantiation-no-ddl.t 
new/DBIx-Class-DeploymentHandler-0.002233/t/02-instantiation-no-ddl.t
--- old/DBIx-Class-DeploymentHandler-0.002232/t/02-instantiation-no-ddl.t       
2019-06-07 03:49:31.000000000 +0200
+++ new/DBIx-Class-DeploymentHandler-0.002233/t/02-instantiation-no-ddl.t       
2019-09-25 19:32:25.000000000 +0200
@@ -32,7 +32,6 @@
 
   ok($handler, 'DBIx::Class::DeploymentHandler w/1 instantiates correctly');
 
-  my $version = $s->schema_version;
   $handler->prepare_install;
 
   dies_ok {
@@ -65,7 +64,6 @@
 
   ok($handler, 'DBIx::Class::DeploymentHandler w/2 instantiates correctly');
 
-  my $version = $s->schema_version();
   $handler->prepare_install;
   dies_ok {
     $s->resultset('Foo')->create({
@@ -102,7 +100,6 @@
 
   ok($handler, 'DBIx::Class::DeploymentHandler w/3 instantiates correctly');
 
-  my $version = $s->schema_version();
   $handler->prepare_install;
   dies_ok {
     $s->resultset('Foo')->create({
@@ -135,7 +132,6 @@
 
   ok($handler, 'DBIx::Class::DeploymentHandler w/2 instantiates correctly');
 
-  my $version = $s->schema_version();
   lives_ok {
     $s->resultset('Foo')->create({
       bar => 'frew',
@@ -160,6 +156,44 @@
 
   is $handler->version_storage->database_version => 2,
     'database version is down to 2';
+}
+
+DOWN1: {
+  use_ok 'DBICVersion_v1';
+  my $s = DBICVersion::Schema->connect(@connection);
+  $DBICVersion::Schema::VERSION = 1;
+  ok($s, 'DBICVersion::Schema 1 instantiates correctly');
+  my $handler = DH->new({
+    ignore_ddl => 1,
+    script_directory => $sql_dir,
+    schema => $s,
+    databases => [],
+    txn_prep => 0,
+  });
+
+  ok($handler, 'DBIx::Class::DeploymentHandler w/1 instantiates correctly');
+
+  lives_ok {
+    $s->resultset('Foo')->create({
+      bar => 'frew',
+      baz => 'frew',
+    })
+  } 'schema at version 2';
+  $handler->downgrade;
+  dies_ok {
+    $s->resultset('Foo')->create({
+      bar => 'frew',
+      baz => 'frew',
+    })
+  } 'schema not at version 2';
+  lives_ok {
+    $s->resultset('Foo')->create({
+      bar => 'frew',
+    })
+  } 'schema is at version 1';
+
+  is $handler->version_storage->database_version => 1,
+    'database version is down to 1';
 
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/DBIx-Class-DeploymentHandler-0.002232/t/10-split-sql-chunk.t 
new/DBIx-Class-DeploymentHandler-0.002233/t/10-split-sql-chunk.t
--- old/DBIx-Class-DeploymentHandler-0.002232/t/10-split-sql-chunk.t    
2019-06-07 03:49:31.000000000 +0200
+++ new/DBIx-Class-DeploymentHandler-0.002233/t/10-split-sql-chunk.t    
2019-09-25 19:32:25.000000000 +0200
@@ -1,20 +1,22 @@
 use strict;
 use warnings;
+use 5.010;
 
 use Test::More;
 
 use DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator;
 
 sub make_dm {
-  my ($storage_class) = @_;
+  my $storage_class = shift;
   bless {
     storage => bless({}, 'DBIx::Class::Storage::DBI::'.$storage_class),
+    @_,
   }, 'DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator';
 }
 
-my $dm = make_dm('MySQL');
+my $dm = make_dm('mysql');
 
-is_deeply [ $dm->_split_sql_chunk( <<'END' ) ], [ 'SELECT * FROM YADAH END' ];
+is_deeply [ $dm->_split_sql_chunk( <<'END' ) ], [ 'BEGIN SELECT * FROM YADAH 
END' ];
 BEGIN
     -- stuff
     SELECT * FROM YADAH
@@ -23,6 +25,65 @@
 
 is_deeply [ $dm->_split_sql_chunk( 'foo', ' ', 'bar' ) ], [qw(foo bar)];
 
+$dm = make_dm('mysql', txn_prep => 1);  # default, bw-comp.
+
+is_deeply [ $dm->_split_sql_chunk( <<'END' ) ],
+BEGIN;
+-- stuff
+DELIMITER $$
+insert into door (color) VALUES ('#f00')$$
+SELECT * FROM YADAH$$
+DELIMITER ;
+Commit;
+END
+  [
+    q(insert into door (color) VALUES ('#f00')),
+    'SELECT * FROM YADAH',
+  ];
+
+$dm = make_dm('mysql', txn_prep => 0);
+
+is_deeply [ $dm->_split_sql_chunk( <<'END' ) ],
+BEGIN;
+-- stuff
+DELIMITER $$
+insert into door (color) VALUES ('#000')$$
+SELECT * FROM YADAH$$
+DELIMITER ;
+Commit;
+END
+  [
+    'BEGIN',
+    q(insert into door (color) VALUES ('#000')),
+    'SELECT * FROM YADAH',
+    'Commit',
+  ];
+
+$dm = make_dm('mysql', txn_prep => 0);
+
+is_deeply [ $dm->_split_sql_chunk( <<'END' ) ],
+insert into door (color) VALUES ('#000');
+
+CREATE TRIGGER upd_check BEFORE UPDATE ON account
+     FOR EACH ROW
+     BEGIN
+         IF NEW.amount < 0 THEN
+             SET NEW.amount = 0;
+         ELSEIF NEW.amount > 100 THEN
+             SET NEW.amount = 100;
+         END IF;
+     END;
+
+SELECT * FROM YADAH;
+
+END
+  [
+    q(insert into door (color) VALUES ('#000')),
+    'CREATE TRIGGER upd_check BEFORE UPDATE ON account FOR EACH ROW BEGIN IF 
NEW.amount < 0 THEN SET NEW.amount = 0; ELSEIF NEW.amount > 100 THEN SET 
NEW.amount = 100; END IF; END',
+    'SELECT * FROM YADAH',
+  ];
+
+
 $dm = make_dm('Pg');
 is_deeply [ $dm->_split_sql_chunk( <<'END' ) ],
 -- Add triggers to maintain sync between list_material_ratings table and 
list_materials table:;
@@ -38,7 +99,7 @@
  END;
 $add_rating$ LANGUAGE plpgsql;
 END
-  [ q{CREATE FUNCTION add_rating() RETURNS trigger AS $add_rating$ IF 
NEW."type" = 'like' THEN UPDATE "list_materials" SET "likes" = (SELECT COUNT(*) 
FROM "list_material_ratings" WHERE "list" = NEW."list" AND "material" = 
NEW."material" AND "type" = 'like') WHERE "list" = NEW."list" AND "material" = 
NEW."material"; END IF; IF NEW."type" = 'dislike' THEN UPDATE "list_materials" 
SET "dislikes" = (SELECT COUNT(*) FROM "list_material_ratings" WHERE "list" = 
NEW."list" AND "material" = NEW."material" AND "type" = 'dislike') WHERE "list" 
= NEW."list" AND "material" = NEW."material"; END IF; RETURN NULL; END; 
$add_rating$ LANGUAGE plpgsql} ];
+  [ q{CREATE FUNCTION add_rating() RETURNS trigger AS $add_rating$ BEGIN IF 
NEW."type" = 'like' THEN UPDATE "list_materials" SET "likes" = (SELECT COUNT(*) 
FROM "list_material_ratings" WHERE "list" = NEW."list" AND "material" = 
NEW."material" AND "type" = 'like') WHERE "list" = NEW."list" AND "material" = 
NEW."material"; END IF; IF NEW."type" = 'dislike' THEN UPDATE "list_materials" 
SET "dislikes" = (SELECT COUNT(*) FROM "list_material_ratings" WHERE "list" = 
NEW."list" AND "material" = NEW."material" AND "type" = 'dislike') WHERE "list" 
= NEW."list" AND "material" = NEW."material"; END IF; RETURN NULL; END; 
$add_rating$ LANGUAGE plpgsql} ];
 
 $dm = make_dm('Pg');
 is_deeply [ $dm->_split_sql_chunk( <<'END' ) ],


Reply via email to