third time's a charm - fix a small bug and make more analogous to HEAD - RT#8605
[freeside.git] / FS / FS / Upgrade.pm
index 97f24d4..aea7154 100644 (file)
@@ -42,6 +42,10 @@ sub upgrade {
 
   my $data = upgrade_data(%opt);
 
+  my $oldAutoCommit = $FS::UID::AutoCommit;
+  local $FS::UID::AutoCommit = 0;
+  local $FS::UID::AutoCommit = 0;
+
   foreach my $table ( keys %$data ) {
 
     my $class = "FS::$table";
@@ -53,13 +57,10 @@ sub upgrade {
 
       my $start = time;
 
-      my $oldAutoCommit = $FS::UID::AutoCommit;
-      local $FS::UID::AutoCommit = 0;
-      $FS::UID::AutoCommit = 0;
-
       $class->_upgrade_data(%opt);
 
       if ( $oldAutoCommit ) {
+        warn "  committing\n";
         dbh->commit or die dbh->errstr;
       }
       
@@ -91,12 +92,14 @@ sub upgrade_data {
 
   tie my %hash, 'Tie::IxHash', 
 
+    #cust_main (remove paycvv from history)
+    'cust_main' => [],
+
     #msgcat
     'msgcat' => [],
 
     #reason type and reasons
     'reason_type'     => [],
-    'reason'          => [],
     'cust_pkg_reason' => [],
 
     #need part_pkg before cust_credit...
@@ -126,6 +129,15 @@ sub upgrade_data {
     #fixup access rights
     'access_right' => [],
 
+    #change recur_flat and enable_prorate
+    'part_pkg_option' => [],
+
+    #add weights to pkg_category
+    'pkg_category' => [],
+
+    #cdrbatch fixes
+    'cdr' => [],
+
   ;
 
   \%hash;