projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1804c24
)
commit after each table upgrade, helps with getting huge dbs upgraded, RT#4679
author
ivan
<ivan>
Sun, 1 Feb 2009 04:13:35 +0000
(
04:13
+0000)
committer
ivan
<ivan>
Sun, 1 Feb 2009 04:13:35 +0000
(
04:13
+0000)
FS/FS/Upgrade.pm
patch
|
blob
|
history
diff --git
a/FS/FS/Upgrade.pm
b/FS/FS/Upgrade.pm
index
452c5a3
..
f10ff06
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,17
@@
sub upgrade {
if ( $class->can('_upgrade_data') ) {
warn "Upgrading $table...\n";
if ( $class->can('_upgrade_data') ) {
warn "Upgrading $table...\n";
+
+ 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;
+ }
+
} 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
+78,6
@@
sub upgrade {
}
}
- if ( $oldAutoCommit ) {
- dbh->commit or die dbh->errstr;
- }
-
}
}