CGI::param called in list context
[freeside.git] / FS / bin / freeside-upgrade
index e74abbf..e17895d 100755 (executable)
@@ -100,11 +100,12 @@ if ( dbdef->table('upgrade_journal') ) {
                      ( SELECT MAX(upgradenum) FROM upgrade_journal )
                    )
     ";
-  } elsif ( driver_name =~ /^mysql/i ) {
-    push @bugfix, "
-       ALTER TABLE upgrade_journal AUTO_INCREMENT =
-                   ( ( SELECT MAX(upgradenum) FROM upgrade_journal ) + 1 )
-    ";
+  #MySQL can't do this in a statement so have to do it manually
+  #} elsif ( driver_name =~ /^mysql/i ) {
+  #  push @bugfix, "
+  #     ALTER TABLE upgrade_journal AUTO_INCREMENT =
+  #                 ( ( SELECT MAX(upgradenum) FROM upgrade_journal ) + 1 )
+  #  ";
   }
 }
 
@@ -156,7 +157,7 @@ while ( $cf = $cfsth->fetchrow_hashref ) {
     my $name = $cf->{'name'};
     $name = lc($name) unless driver_name =~ /^mysql/i;
 
-    @statements = grep { $_ !~ /^\s*ALTER\s+TABLE\s+(h_|)$tbl\s+DROP\s+COLUMN\s+cf_$name\s*$/i }
+    @statements = grep { $_ !~ /^\s*ALTER\s+TABLE\s+(h_|)$tbl DROP\s+COLUMN\s+cf_$name/i }
                                                                     @statements;
     push @statements, 
         "ALTER TABLE $tbl ADD COLUMN cf_$name varchar(".$cf->{'length'}.")"
@@ -312,7 +313,7 @@ print "\n" if $DRY_RUN;
 
 if ( $dbh->{Driver}->{Name} =~ /^mysql/i && ! $opt_s ) {
 
-  foreach my $table (qw( svc_acct svc_phone )) {
+  foreach my $table (qw( svc_acct svc_phone cust_main_county )) {
 
     my $sth = $dbh->prepare(
       "SELECT COUNT(*) FROM duplicate_lock WHERE lockname = '$table'"
@@ -464,14 +465,13 @@ Also performs other upgrade functions:
           current default.
 
   [ -s ]: Schema changes only.  Useful for Pg/slony slaves where the data
+          changes will be replicated from the Pg/slony master.
 
   [ -r ]: Skip sqlradius updates.  Useful for occassions where the sqlradius
           databases may be inaccessible.
 
   [ -c ]: Skip cdr and h_cdr updates.
 
-          changes will be replicated from the Pg/slony master.
-
   [ -j ]: Run certain upgrades asychronously from the job queue.  Currently 
           used only for the 2.x -> 3.x cust_location, cust_pay and part_pkg
           upgrades.  This may cause odd behavior before the upgrade is