diff options
author | ivan <ivan> | 2005-07-11 14:15:09 +0000 |
---|---|---|
committer | ivan <ivan> | 2005-07-11 14:15:09 +0000 |
commit | b07d04cabdee3bf60e1ef9c622e1e71aade7b46a (patch) | |
tree | 42e1e588a0085c3983bd2386610a8060c9a42220 /bin | |
parent | 59e0ebbe4d3a271fe46cf5c5b664aeda888d7790 (diff) |
adding rt-drop-tables
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/rate.import | 28 | ||||
-rwxr-xr-x | bin/rt-drop-tables | 29 |
2 files changed, 48 insertions, 9 deletions
diff --git a/bin/rate.import b/bin/rate.import index 29b5239d5..fdd756d72 100755 --- a/bin/rate.import +++ b/bin/rate.import @@ -59,15 +59,25 @@ while ( my $row = $sth->fetchrow_hashref ) { $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, diff --git a/bin/rt-drop-tables b/bin/rt-drop-tables new file mode 100755 index 000000000..b027542b3 --- /dev/null +++ b/bin/rt-drop-tables @@ -0,0 +1,29 @@ +#!/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"; +} + |