address standardization part one, finally checked in from here
[freeside.git] / FS / FS / Upgrade.pm
index 90e66d8..fcf28e3 100644 (file)
@@ -49,8 +49,12 @@ sub upgrade {
     eval "use $class;";
     die $@ if $@;
 
-    $class->_upgrade_data(%opt)
-      if $class->can('_upgrade_data');
+    if ( $class->can('_upgrade_data') ) {
+      $class->_upgrade_data(%opt);
+    } else {
+      warn "WARNING: asked for upgrade of $table,".
+           " but FS::$table has no _upgrade_data method\n";
+    }
 
 #    my @records = @{ $data->{$table} };
 #
@@ -80,6 +84,9 @@ sub upgrade_data {
     'reason_type' => [],
     'reason'      => [],
 
+    #need part_pkg before cust_credit...
+    'part_pkg' => [],
+
     #customer credits
     'cust_credit' => [],
 
@@ -88,6 +95,10 @@ sub upgrade_data {
 
     #populate cust_pay.otaker
     'cust_pay'    => [],
+
+    #populate part_pkg_taxclass for starters
+    'part_pkg_taxclass' => [],
+
   ;
 
   \%hash;