[freeside-commits]
freeside/bin rate.import, 1.1, 1.2 rt-drop-tables, NONE, 1.1
Ivan,,,
ivan at wavetail.420.am
Mon Jul 11 07:15:11 PDT 2005
Update of /home/cvs/cvsroot/freeside/bin
In directory wavetail:/tmp/cvs-serv23901
Modified Files:
rate.import
Added Files:
rt-drop-tables
Log Message:
adding rt-drop-tables
Index: rate.import
===================================================================
RCS file: /home/cvs/cvsroot/freeside/bin/rate.import,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- rate.import 23 Dec 2004 08:00:15 -0000 1.1
+++ rate.import 11 Jul 2005 14:15:09 -0000 1.2
@@ -59,15 +59,25 @@
$prefix = $2;
}
- my @rate_prefix = map {
- #warn $row->{'Country'}. ": $prefixprefix$_\n";
- new FS::rate_prefix {
- 'countrycode' => $row->{'Code'},
- 'npa' => $prefixprefix.$_,
- };
- }
- split(/\s*[;,]\s*/, $prefix);
+ my @rate_prefix = ();
+ if ( $prefix =~ /\d/ ) {
+
+ @rate_prefix = map {
+ #warn $row->{'Country'}. ": $prefixprefix$_\n";
+ new FS::rate_prefix {
+ 'countrycode' => $row->{'Code'},
+ 'npa' => $prefixprefix.$_,
+ };
+ }
+ split(/\s*[;,]\s*/, $prefix);
+ } else {
+ @rate_prefix = ( new FS::rate_prefix {
+ 'countycode' => $row->{'Code'},
+ 'npa' => '',
+ };
+ );
+ }
my $dest_detail = new FS::rate_detail {
'ratenum' => $ratenum,
--- NEW FILE: rt-drop-tables ---
#!/usr/bin/perl
my @tables = qw(
Attachments
Queues
Links
Principals
Groups
ScripConditions
Transactions
Scrips
ACL
GroupMembers
CachedGroupMembers
Users
Tickets
ScripActions
Templates
TicketCustomFieldValues
CustomFields
CustomFieldValues
sessions
);
foreach my $table ( @tables ) {
print "drop table $table;\n";
print "drop sequence ${table}_id_seq;\n";
}
More information about the freeside-commits
mailing list