[freeside-commits] branch master updated. b617db414a0073ae69f7416d113541679f5d7bfd
Christopher Burger
burgerc at freeside.biz
Thu Aug 2 06:45:53 PDT 2018
The branch, master has been updated
via b617db414a0073ae69f7416d113541679f5d7bfd (commit)
from 60d10560a2956f63a430febc4e3e124280d6a4eb (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit b617db414a0073ae69f7416d113541679f5d7bfd
Author: Christopher Burger <burgerc at freeside.biz>
Date: Thu Aug 2 09:45:51 2018 -0400
RT# 78356 - sped up update query
diff --git a/bin/move_svc_broadband_speeds.pl b/bin/move_svc_broadband_speeds.pl
index fed405b43..8a9af99f2 100644
--- a/bin/move_svc_broadband_speeds.pl
+++ b/bin/move_svc_broadband_speeds.pl
@@ -10,19 +10,33 @@ my $dbh = adminsuidsetup($user);
my $fcc_up_speed = "(select part_pkg_fcc_option.optionvalue from part_pkg_fcc_option where fccoptionname = 'broadband_upstream' and pkgpart = cust_pkg.pkgpart) AS fcc477_upstream";
my $fcc_down_speed = "(select part_pkg_fcc_option.optionvalue from part_pkg_fcc_option where fccoptionname = 'broadband_downstream' and pkgpart = cust_pkg.pkgpart) AS fcc477_downstream";
+
foreach my $rec (qsearch({
- 'select' => 'svc_broadband.*, cust_svc.svcpart, cust_pkg.pkgpart, '.$fcc_up_speed.', '.$fcc_down_speed,
- 'table' => 'svc_broadband',
- 'addl_from' => 'LEFT JOIN cust_svc USING ( svcnum ) LEFT JOIN cust_pkg USING ( pkgnum )',
+ 'select' => 'svc_broadband.*, cust_svc.svcpart, cust_pkg.pkgpart, '.$fcc_up_speed.', '.$fcc_down_speed,
+ 'table' => 'svc_broadband',
+ 'addl_from' => 'LEFT JOIN cust_svc USING ( svcnum ) LEFT JOIN cust_pkg USING ( pkgnum )',
})) {
$rec->{Hash}->{speed_test_up} = $rec->{Hash}->{speed_up};
$rec->{Hash}->{speed_test_down} = $rec->{Hash}->{speed_down};
$rec->{Hash}->{speed_up} = $rec->{Hash}->{fcc477_upstream} * 1000;
$rec->{Hash}->{speed_down} = $rec->{Hash}->{fcc477_downstream} * 1000;
- $rec->replace();
+
+ my $sql = "UPDATE svc_broadband set
+ speed_up = $rec->{Hash}->{speed_up},
+ speed_down = $rec->{Hash}->{speed_down},
+ speed_test_up = $rec->{Hash}->{speed_test_up},
+ speed_test_down = $rec->{Hash}->{speed_test_down}
+ WHERE svcnum = $rec->{Hash}->{svcnum}";
+
warn "Fixing broadband service speeds for service ".$rec->{Hash}->{svcnum}."-".$rec->{Hash}->{description}."\n";
+
+ my $sth = $dbh->prepare($sql) or die $dbh->errstr;
+ $sth->execute or die $sth->errstr;
+
}
+$dbh->commit;
+
warn "Completed fixing broadband service speeds!\n";
exit;
-----------------------------------------------------------------------
Summary of changes:
bin/move_svc_broadband_speeds.pl | 22 ++++++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)
More information about the freeside-commits
mailing list