[freeside-commits] [SCM] Freeside billing, trouble ticketing, network monitoring and provisioning branch master updated. 65326fcac5b2de80d211df3fc160745fb2f46b9b
Ivan
ivan at 420.am
Sun Feb 19 18:24:06 PST 2012
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Freeside billing, trouble ticketing, network monitoring and provisioning".
The branch, master has been updated
via 65326fcac5b2de80d211df3fc160745fb2f46b9b (commit)
from 47ce31789b1194f28ffef2d84ec41b3471a3ba5b (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 65326fcac5b2de80d211df3fc160745fb2f46b9b
Author: Ivan Kohler <ivan at freeside.biz>
Date: Sun Feb 19 18:24:02 2012 -0800
adding some old random tools from the CVS tree
diff --git a/bin/fix-dup-rate_prefix b/bin/fix-dup-rate_prefix
new file mode 100755
index 0000000..c6a4557
--- /dev/null
+++ b/bin/fix-dup-rate_prefix
@@ -0,0 +1,30 @@
+#!/usr/bin/perl
+
+use FS::UID qw(adminsuidsetup);
+use FS::Record qw(qsearch);
+use FS::rate_prefix;
+
+adminsuidsetup shift;
+
+#select * from rate_prefix where 1 < ( select count(*) from rate_prefix as other where rate_prefix.countrycode = other.countrycode and ( rate_prefix.npa = other.npa or ( rate_prefix.npa is null and other.npa is null ) ) ) order by countrycode, npa;
+
+foreach my $dup (
+ qsearch({
+ 'select' => 'DISTINCT ON ( countrycode, npa ) *',
+ 'table' => 'rate_prefix',
+ 'extra_sql' => ' where 1 < ( select count(*) from rate_prefix as other where rate_prefix.countrycode = other.countrycode and ( rate_prefix.npa = other.npa or ( rate_prefix.npa is null and other.npa is null ) ) )',
+ })
+
+) {
+
+ my @all = qsearch('rate_prefix', { map { $_=>$dup->$_() } qw( countrycode npa ) } );
+
+ my $first = shift(@all);
+
+ foreach my $extra (@all) {
+
+
+
+ }
+
+}
-----------------------------------------------------------------------
Summary of changes:
bin/fix-dup-rate_prefix | 30 ++++++++++++++++++++++++++++++
1 files changed, 30 insertions(+), 0 deletions(-)
create mode 100755 bin/fix-dup-rate_prefix
hooks/post-receive
--
Freeside billing, trouble ticketing, network monitoring and provisioning
More information about the freeside-commits
mailing list