diff options
author | mark <mark> | 2010-10-23 08:09:54 +0000 |
---|---|---|
committer | mark <mark> | 2010-10-23 08:09:54 +0000 |
commit | 701d8f35fff2ed748efa6b46cd3cf9cc46e47729 (patch) | |
tree | 80f91d6a1316fbca53bac46b1e79d6734d12947a | |
parent | 4c0809489595d75c02c1aca6760c5c34c6af37e4 (diff) |
moved to upgrade script
-rwxr-xr-x | bin/fix-contract_end | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/bin/fix-contract_end b/bin/fix-contract_end deleted file mode 100755 index 6458722ef..000000000 --- a/bin/fix-contract_end +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/perl - -use strict; -use warnings; -use FS::Record; -use FS::UID qw(adminsuidsetup dbh driver_name); - -# Fix bad values in some contract_end fields resulting from a short-lived bug - -my $dbh = adminsuidsetup(shift) or die "Usage: fix-contract_end username\n"; -local $FS::UID::AutoCommit = 0; - -my @updates = ( - q!UPDATE cust_pkg SET contract_end = NULL WHERE contract_end = -1!, - q!UPDATE part_pkg_option SET optionvalue = NULL WHERE optionname = 'contract_end_months' AND optionvalue = '(none)'!, -); - -foreach my $sql (@updates) { - print "$sql\n"; - my $rows = $dbh->do($sql); - print "$rows rows.\n"; - die $dbh->errstr if $dbh->errstr; -} -$dbh->commit or die $dbh->errstr; |