per address block ip auto assignment and auto router selection
[freeside.git] / FS / FS / Upgrade.pm
index 6794f4d..57c94ac 100644 (file)
@@ -1,7 +1,7 @@
 package FS::Upgrade;
 
 use strict;
-use vars qw( @ISA @EXPORT_OK );
+use vars qw( @ISA @EXPORT_OK $DEBUG );
 use Exporter;
 use Tie::IxHash;
 use FS::UID qw( dbh driver_name );
@@ -14,6 +14,8 @@ $FS::svc_domain::whois_hack = 1;
 @ISA = qw( Exporter );
 @EXPORT_OK = qw( upgrade upgrade_sqlradius );
 
+$DEBUG = 1;
+
 =head1 NAME
 
 FS::Upgrade - Database upgrade routines
@@ -51,6 +53,7 @@ sub upgrade {
     die $@ if $@;
 
     if ( $class->can('_upgrade_data') ) {
+      warn "Upgrading $table...\n";
       $class->_upgrade_data(%opt);
     } else {
       warn "WARNING: asked for upgrade of $table,".
@@ -82,8 +85,9 @@ sub upgrade_data {
   tie my %hash, 'Tie::IxHash', 
 
     #reason type and reasons
-    'reason_type' => [],
-    'reason'      => [],
+    'reason_type'     => [],
+    'reason'          => [],
+    'cust_pkg_reason' => [],
 
     #need part_pkg before cust_credit...
     'part_pkg' => [],
@@ -103,6 +107,15 @@ sub upgrade_data {
     #remove bad pending records
     'cust_pay_pending' => [],
 
+    #replace invnum and pkgnum with billpkgnum
+    'cust_bill_pkg_detail' => [],
+
+    #usage_classes if we have none
+    'usage_class' => [],
+
+    #fixup access rights
+    'access_right' => [],
+
   ;
 
   \%hash;