diff options
-rw-r--r-- | FS/FS/Upgrade.pm | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/FS/FS/Upgrade.pm b/FS/FS/Upgrade.pm index d3f624bea..894399296 100644 --- a/FS/FS/Upgrade.pm +++ b/FS/FS/Upgrade.pm @@ -42,6 +42,10 @@ sub upgrade { my $data = upgrade_data(%opt); + my $oldAutoCommit = $FS::UID::AutoCommit; + local $FS::UID::AutoCommit = 0; + local $FS::UID::AutoCommit = 0; + foreach my $table ( keys %$data ) { my $class = "FS::$table"; @@ -53,13 +57,10 @@ sub upgrade { my $start = time; - my $oldAutoCommit = $FS::UID::AutoCommit; - local $FS::UID::AutoCommit = 0; - local $FS::UID::AutoCommit = 0; - $class->_upgrade_data(%opt); if ( $oldAutoCommit ) { + warn " committing"; dbh->commit or die dbh->errstr; } |