This commit was generated by cvs2svn to compensate for changes in r6255,
[freeside.git] / FS / bin / freeside-upgrade
index fa9f900..d143d92 100755 (executable)
@@ -93,9 +93,6 @@ if ( $dbh->{Driver}->{Name} =~ /^mysql/i ) {
   }
 }
 
-upgrade()
-  unless $DRY_RUN;
-
 $dbh->commit or die $dbh->errstr;
 
 dbdef_create($dbh, $dbdef_file);
@@ -103,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;
@@ -121,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