chiark / gitweb /
Move referential integrity check into CommodsDatabase
[ypp-sc-tools.db-live.git] / yarrg / db-idempotent-populate
index 6ca83829355fc6f9504cbd41694e934bfd156c69..2e0b0ae5155d41d0128fb788d7b4eefca74d1040 100755 (executable)
@@ -117,7 +117,6 @@ $fields );
 
  DROP TABLE aside_$table;
 END
-    $dbh->commit;
 }
 
 table('commods', <<END);
@@ -176,7 +175,7 @@ db_doall(<<END)
 END
     ;
 
-$dbh->commit;
+db_chkcommit();
 
 #---------- commodity list ----------
 
@@ -253,7 +252,7 @@ END
     foreach my $cl (sort keys %incl) {
        $addclass->execute($cl, $incl{$cl});    
     }
-    $dbh->commit;
+    db_chkcommit();
 }
 
 #---------- vessel types ----------
@@ -271,5 +270,5 @@ END
        my @qa= ($name, $shotdamage, map { $v->{$_} } qw(Mass Volume));
        $idempotent->execute(@qa);
     }
-    $dbh->commit;
+    db_chkcommit();
 }