[freeside-commits] freeside/FS/bin freeside-upgrade,1.24,1.25

Ivan,,, ivan at wavetail.420.am
Sun Dec 21 13:33:30 PST 2008


Update of /home/cvs/cvsroot/freeside/FS/bin
In directory wavetail.420.am:/tmp/cvs-serv7874/FS/bin

Modified Files:
	freeside-upgrade 
Log Message:
unique checking for svc_phone like svc_acct, closes: RT#4204 (also a few lines of the new per-agent config snuck in Conf.pm from RT#3989)

Index: freeside-upgrade
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/bin/freeside-upgrade,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- freeside-upgrade	30 May 2008 01:33:50 -0000	1.24
+++ freeside-upgrade	21 Dec 2008 21:33:28 -0000	1.25
@@ -77,21 +77,26 @@
 
 if ( $dbh->{Driver}->{Name} =~ /^mysql/i && ! $opt_s ) {
 
-  my $sth = $dbh->prepare(
-    "SELECT COUNT(*) FROM duplicate_lock WHERE lockname = 'svc_acct'"
-  ) or die $dbh->errstr;
-
-  $sth->execute or die $sth->errstr;
-
-  unless ( $sth->fetchrow_arrayref->[0] ) {
+  foreach my $table (qw( svc_acct svc_phone )) {
 
-    $sth = $dbh->prepare(
-      "INSERT INTO duplicate_lock ( lockname ) VALUES ( 'svc_acct' )"
+    my $sth = $dbh->prepare(
+      "SELECT COUNT(*) FROM duplicate_lock WHERE lockname = '$table'"
     ) or die $dbh->errstr;
 
     $sth->execute or die $sth->errstr;
 
+    unless ( $sth->fetchrow_arrayref->[0] ) {
+
+      $sth = $dbh->prepare(
+        "INSERT INTO duplicate_lock ( lockname ) VALUES ( '$table' )"
+      ) or die $dbh->errstr;
+
+      $sth->execute or die $sth->errstr;
+
+    }
+
   }
+
 }
 
 $dbh->commit or die $dbh->errstr;



More information about the freeside-commits mailing list