prepaid cdr pickup & bill daemon, RT#4184
[freeside.git] / FS / bin / freeside-upgrade
index e68f5e3..f3c4461 100755 (executable)
@@ -11,7 +11,7 @@ use FS::Schema qw( dbdef dbdef_dist reload_dbdef );
 use FS::Misc::prune qw(prune_applications);
 use FS::Conf;
 use FS::Record qw(qsearch);
-use FS::Upgrade qw(upgrade);
+use FS::Upgrade qw(upgrade upgrade_sqlradius);
 
 die "Not running uid freeside!" unless checkeuid();
 
@@ -70,8 +70,9 @@ if ( $DRY_RUN ) {
 
 my $hashref = {};
 $hashref->{dry_run} = 1 if $DRY_RUN;
-$hashref->{debug} = 1 if $DEBUG;
-print join "\n", prune_applications($hashref) unless $opt_s;
+$hashref->{debug} = 1 if $DEBUG && $DRY_RUN;
+prune_applications($hashref) unless $opt_s;
+
 print "\n" if $DRY_RUN;
 
 if ( $dbh->{Driver}->{Name} =~ /^mysql/i && ! $opt_s ) {
@@ -123,6 +124,9 @@ $dbh = adminsuidsetup($user);
 upgrade()
   unless $DRY_RUN || $opt_s;
 
+upgrade_sqlradius()
+  unless $DRY_RUN || $opt_s;
+
 $dbh->commit or die $dbh->errstr;
 $dbh->disconnect or die $dbh->errstr;
 
@@ -135,7 +139,7 @@ sub dbdef_create { # reverse engineer the schema from the DB and save to file
 }
 
 sub usage {
-  die "Usage:\n  freeside-upgrade [ -d ] [ -q | -v ] user\n"; 
+  die "Usage:\n  freeside-upgrade [ -d ] [ -s ] [ -q | -v ] user\n"; 
 }
 
 =head1 NAME