small change to ADMIN_adjust_GMTnow script add index to vicidial_list for postal_code

git-svn-id: svn://192.168.202.10@405 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2006-11-23 03:47:53 +00:00
parent 1953cef5c6
commit ce07a37dda
3 changed files with 19 additions and 4 deletions
+15 -3
View File
@@ -261,6 +261,7 @@ foreach (@phone_codes)
##### BEGIN RUN LOOP FOR EACH COUNTRY CODE/AREA CODE RECORD THAT IS INSIDE THIS COUNTRY CODE #####
$e=0;
$area_updated_count=0;
foreach (@codefile)
{
chomp($codefile[$e]);
@@ -401,7 +402,11 @@ foreach (@phone_codes)
{
$stmtA = "update vicidial_list set gmt_offset_now='$area_GMT' where phone_code='$match_code_ORIG' $AC_match and gmt_offset_now != '$area_GMT';";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T) {$affected_rows = $dbhA->do($stmtA); }
if (!$T)
{
$affected_rows = $dbhA->do($stmtA);
$area_updated_count = ($area_updated_count + $affected_rows);
}
$Prec_countW = sprintf("%8s", $rec_countW);
if ($DB) {print " $Prec_countW records in $match_code_ORIG $area_code updated to $area_GMT\n";}
$ee++;
@@ -426,6 +431,7 @@ foreach (@phone_codes)
{
##### BEGIN RUN LOOP FOR EACH POSTAL CODE RECORD THAT IS INSIDE THIS COUNTRY CODE #####
if ($DB) {print "POSTAL CODE RUN START...\n";}
$postal_updated_count=0;
$e=0;
foreach (@postalfile)
{
@@ -550,14 +556,18 @@ foreach (@phone_codes)
if (!$rec_countW)
{
if ($DB) {print " ALL GMT ALREADY CORRECT FOR : $match_code_ORIG $area_code $area_GMT\n";}
if ($DB) {print " ALL GMT ALREADY CORRECT FOR : $match_code_ORIG $postal_code $area_GMT\n";}
$ei++;
}
else
{
$stmtA = "update vicidial_list set gmt_offset_now='$area_GMT' where phone_code='$match_code_ORIG' $AC_match and gmt_offset_now != '$area_GMT';";
if($DB){print STDERR "\n|$stmtA|\n";}
if (!$T) {$affected_rows = $dbhA->do($stmtA); }
if (!$T)
{
$affected_rows = $dbhA->do($stmtA);
$postal_updated_count = ($postal_updated_count + $affected_rows);
}
$Prec_countW = sprintf("%8s", $rec_countW);
if ($DB) {print " $Prec_countW records in $match_code_ORIG $postal_code updated to $area_GMT\n";}
$ee++;
@@ -584,6 +594,8 @@ foreach (@phone_codes)
$dbhA->disconnect();
if($DB){print "Postal Updates: $postal_updated_count\n";}
if($DB){print "Area Code Updates: $area_updated_count\n";}
if($DB){print "\nDONE\n";}
exit;
+2 -1
View File
@@ -267,7 +267,8 @@ index (phone_number),
index (list_id),
index (called_since_last_reset),
index (status),
index (gmt_offset_now)
index (gmt_offset_now),
index (postal_code)
);
CREATE TABLE vicidial_hopper (
+2
View File
@@ -43,3 +43,5 @@ DST_range VARCHAR(8),
country CHAR(3),
country_code SMALLINT(5) UNSIGNED
);
ALTER TABLE vicidial_list ADD index (postal_code);