sub upgrade {
my %opt = @_;
+ my $data = upgrade_data(%opt);
+
my $oldAutoCommit = $FS::UID::AutoCommit;
local $FS::UID::AutoCommit = 0;
- $FS::UID::AutoCommit = 0;
-
- my $data = upgrade_data(%opt);
+ local $FS::UID::AutoCommit = 0;
foreach my $table ( keys %$data ) {
if ( $class->can('_upgrade_data') ) {
warn "Upgrading $table...\n";
+
+ my $start = time;
+
$class->_upgrade_data(%opt);
+
+ if ( $oldAutoCommit ) {
+ warn " committing\n";
+ dbh->commit or die dbh->errstr;
+ }
+
+ #warn "\e[1K\rUpgrading $table... done in ". (time-$start). " seconds\n";
+ warn " done in ". (time-$start). " seconds\n";
+
} else {
warn "WARNING: asked for upgrade of $table,".
" but FS::$table has no _upgrade_data method\n";
}
- if ( $oldAutoCommit ) {
- dbh->commit or die dbh->errstr;
- }
-
}
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...
#usage_classes if we have none
'usage_class' => [],
+ #phone_type if we have none
+ 'phone_type' => [],
+
#fixup access rights
'access_right' => [],
+ #change recur_flat and enable_prorate
+ 'part_pkg_option' => [],
+
+ #add weights to pkg_category
+ 'pkg_category' => [],
+
+ #cdrbatch fixes
+ 'cdr' => [],
+
+ #otaker->usernum
+ 'cust_attachment' => [],
+ #'cust_credit' => [],
+ #'cust_main' => [],
+ 'cust_main_note' => [],
+ #'cust_pay' => [],
+ 'cust_pay_void' => [],
+ 'cust_pkg' => [],
+ #'cust_pkg_reason' => [],
+ 'cust_pkg_discount' => [],
+ 'cust_refund' => [],
+ 'banned_pay' => [],
+
;
\%hash;