[freeside-commits] freeside/FS/FS cust_pay_pending.pm, 1.1.2.4, 1.1.2.5 Upgrade.pm, 1.1.2.8, 1.1.2.9
Ivan,,,
ivan at wavetail.420.am
Thu May 29 17:53:09 PDT 2008
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv10148
Modified Files:
Tag: FREESIDE_1_7_BRANCH
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.1.2.8
retrieving revision 1.1.2.9
diff -u -d -r1.1.2.8 -r1.1.2.9
--- Upgrade.pm 20 May 2008 03:52:06 -0000 1.1.2.8
+++ Upgrade.pm 30 May 2008 00:53:05 -0000 1.1.2.9
@@ -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.1.2.4
retrieving revision 1.1.2.5
diff -u -d -r1.1.2.4 -r1.1.2.5
--- cust_pay_pending.pm 19 Feb 2008 02:33:14 -0000 1.1.2.4
+++ cust_pay_pending.pm 30 May 2008 00:53:04 -0000 1.1.2.5
@@ -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