This commit was generated by cvs2svn to compensate for changes in r6255,
[freeside.git] / FS / bin / freeside-upgrade
index 04bcb23..d143d92 100755 (executable)
@@ -93,14 +93,6 @@ if ( $dbh->{Driver}->{Name} =~ /^mysql/i ) {
   }
 }
 
-$dbh->commit or die $dbh->errstr;  # we *MUST* commit before upgrading data
-dbdef_create($dbh, $dbdef_file);
-delete $FS::Schema::dbdef_cache{$dbdef_file}; #force an actual reload
-reload_dbdef($dbdef_file);
-
-upgrade()
-  unless $DRY_RUN;
-
 $dbh->commit or die $dbh->errstr;
 
 dbdef_create($dbh, $dbdef_file);
@@ -108,7 +100,7 @@ dbdef_create($dbh, $dbdef_file);
 $dbh->disconnect or die $dbh->errstr;
 
 delete $FS::Schema::dbdef_cache{$dbdef_file}; #force an actual reload
-$FS::UID::AutoCommit = 1;
+$FS::UID::AutoCommit = 0;
 $FS::UID::callback_hack = 1;
 $dbh = adminsuidsetup($user);
 $FS::UID::callback_hack = 0;
@@ -126,6 +118,14 @@ unless ( $DRY_RUN ) {
 $dbh->commit or die $dbh->errstr;
 $dbh->disconnect or die $dbh->errstr;
 
+$dbh = adminsuidsetup($user);
+
+upgrade()
+  unless $DRY_RUN;
+
+$dbh->commit or die $dbh->errstr;
+$dbh->disconnect or die $dbh->errstr;
+
 ###
 
 sub dbdef_create { # reverse engineer the schema from the DB and save to file