projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tweak, rearrange, and avoid the vacuum
[freeside.git]
/
FS
/
FS
/
Upgrade.pm
diff --git
a/FS/FS/Upgrade.pm
b/FS/FS/Upgrade.pm
index
452c5a3
..
8cc5c61
100644
(file)
--- a/
FS/FS/Upgrade.pm
+++ b/
FS/FS/Upgrade.pm
@@
-40,10
+40,6
@@
database upgrades.
sub upgrade {
my %opt = @_;
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 ) {
my $data = upgrade_data(%opt);
foreach my $table ( keys %$data ) {
@@
-54,7
+50,22
@@
sub upgrade {
if ( $class->can('_upgrade_data') ) {
warn "Upgrading $table...\n";
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);
$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";
} else {
warn "WARNING: asked for upgrade of $table,".
" but FS::$table has no _upgrade_data method\n";
@@
-72,10
+83,6
@@
sub upgrade {
}
}
- if ( $oldAutoCommit ) {
- dbh->commit or die dbh->errstr;
- }
-
}
}
@@
-84,6
+91,9
@@
sub upgrade_data {
tie my %hash, 'Tie::IxHash',
tie my %hash, 'Tie::IxHash',
+ #cust_main (remove paycvv from history)
+ 'cust_main' => [],
+
#msgcat
'msgcat' => [],
#msgcat
'msgcat' => [],
@@
-116,9
+126,24
@@
sub upgrade_data {
#usage_classes if we have none
'usage_class' => [],
#usage_classes if we have none
'usage_class' => [],
+ #phone_type if we have none
+ 'phone_type' => [],
+
#fixup access rights
'access_right' => [],
#fixup access rights
'access_right' => [],
+ #change tax_rate column types
+ 'tax_rate' => [],
+
+ #change recur_flat and enable_prorate
+ 'part_pkg_option' => [],
+
+ #add weights to pkg_category
+ 'pkg_category' => [],
+
+ #cdrbatch fixes
+ 'cdr' => [],
+
;
\%hash;
;
\%hash;