Regenerate (finally\!) t/lib/sqlite.sql
[dbsrgits/DBIx-Class-Historic.git] / t / lib / DBICTest.pm
index 2208378..a75f485 100755 (executable)
@@ -132,7 +132,11 @@ sub deploy_schema {
         my $sql;
         { local $/ = undef; $sql = <IN>; }
         close IN;
-        ($schema->storage->dbh->do($_) || print "Error on SQL: $_\n") for split(/;\n/, $sql);
+        for my $chunk ( split (/;\s*\n+/, $sql) ) {
+          if ( $chunk =~ / ^ (?! --\s* ) \S /xm ) {  # there is some real sql in the chunk - a non-space at the start of the string which is not a comment
+            $schema->storage->dbh->do($chunk) or print "Error on SQL: $chunk\n";
+          }
+        }
     }
     return;
 }