}
}
-$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
-$dbh = adminsuidsetup($user);
-
-upgrade()
- unless $DRY_RUN;
-
$dbh->commit or die $dbh->errstr;
dbdef_create($dbh, $dbdef_file);
$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