sub upgrade {
my %opt = @_;
- my $oldAutoCommit = $FS::UID::AutoCommit;
- local $FS::UID::AutoCommit = 0;
- $FS::UID::AutoCommit = 0;
-
my $data = upgrade_data(%opt);
foreach my $table ( keys %$data ) {
if ( $class->can('_upgrade_data') ) {
warn "Upgrading $table...\n";
+
+ my $start = time;
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ $FS::UID::AutoCommit = 0;
+
$class->_upgrade_data(%opt);
+
+ if ( $oldAutoCommit ) {
+ 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' => [],
#fixup access rights
'access_right' => [],
+ #change tax_rate column types
+ 'tax_rate' => [],
+
+ #change recur_flat and enable_prorate
+ 'part_pkg_option' => [],
+
;
\%hash;
}
my $svc_acct = qsearchs({
- 'table' => 'svc_acct.*',
+ 'select' => 'svc_acct.*',
+ 'table' => 'svc_acct',
'addl_from' => 'LEFT JOIN cust_svc USING ( svcnum )'.
'LEFT JOIN export_svc USING ( svcpart )',
'hashref' => { 'username' => $username },