[freeside-commits] freeside/FS/bin freeside-upgrade, 1.5.2.2, 1.5.2.3
Jeff Finucane,420,,
jeff at wavetail.420.am
Tue Aug 21 16:52:10 PDT 2007
Update of /home/cvs/cvsroot/freeside/FS/bin
In directory wavetail:/tmp/cvs-serv21914/FS/bin
Modified Files:
Tag: FREESIDE_1_7_BRANCH
freeside-upgrade
Log Message:
agent_custid bugfix (1746) (backport)
Index: freeside-upgrade
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/bin/freeside-upgrade,v
retrieving revision 1.5.2.2
retrieving revision 1.5.2.3
diff -u -d -r1.5.2.2 -r1.5.2.3
--- freeside-upgrade 1 Mar 2007 17:49:22 -0000 1.5.2.2
+++ freeside-upgrade 21 Aug 2007 23:52:08 -0000 1.5.2.3
@@ -34,10 +34,27 @@
$DBIx::DBSchema::DEBUG = $DEBUG;
$DBIx::DBSchema::Table::DEBUG = $DEBUG;
+my @bugfix = ();
+
+if (dbdef->table('cust_main')->column('agent_custid')) {
+ push @bugfix,
+ "UPDATE cust_main SET agent_custid = NULL where agent_custid = ''";
+
+ push @bugfix,
+ "UPDATE h_cust_main SET agent_custid = NULL where agent_custid = ''"
+ if (dbdef->table('h_cust_main'));
+}
+
if ( $DRY_RUN ) {
- print join(";\n", dbdef->sql_update_schema( dbdef_dist, $dbh ) ). ";\n";
+ print
+ join(";\n", @bugfix, dbdef->sql_update_schema( dbdef_dist, $dbh ) ). ";\n";
exit;
} else {
+ foreach my $statement ( @bugfix ) {
+ $dbh->do( $statement )
+ or die "Error: ". $dbh->errstr. "\n executing: $statement";
+ }
+
dbdef->update_schema( dbdef_dist, $dbh );
}
More information about the freeside-commits
mailing list