[freeside-commits] freeside/FS/FS cust_pay_pending.pm, 1.3, 1.4 Upgrade.pm, 1.9, 1.10
Ivan,,,
ivan at wavetail.420.am
Thu May 29 17:53:06 PDT 2008
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv10144
Modified Files:
cust_pay_pending.pm Upgrade.pm
Log Message:
clean up any stray/old cust_pay_pending records causing problems
Index: Upgrade.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Upgrade.pm,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- Upgrade.pm 20 May 2008 03:52:05 -0000 1.9
+++ Upgrade.pm 30 May 2008 00:53:04 -0000 1.10
@@ -100,6 +100,9 @@
#populate part_pkg_taxclass for starters
'part_pkg_taxclass' => [],
+ #remove bad pending records
+ 'cust_pay_pending' => [],
+
;
\%hash;
Index: cust_pay_pending.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_pay_pending.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- cust_pay_pending.pm 19 Feb 2008 02:33:13 -0000 1.3
+++ cust_pay_pending.pm 30 May 2008 00:53:04 -0000 1.4
@@ -215,6 +215,21 @@
$self->SUPER::check;
}
+# _upgrade_data
+#
+# Used by FS::Upgrade to migrate to a new database.
+
+sub _upgrade_data { #class method
+ my ($class, %opts) = @_;
+
+ my $sql =
+ "DELETE FROM cust_pay_pending WHERE status = 'new' AND _date < ".(time-600);
+
+ my $sth = dbh->prepare($sql) or die dbh->errstr;
+ $sth->execute or die $sth->errstr;
+
+}
+
=back
=head1 BUGS
More information about the freeside-commits
mailing list