[freeside-commits] freeside/FS/bin freeside-upgrade,1.11,1.12
Jeff Finucane,420,,
jeff at wavetail.420.am
Thu Aug 16 09:19:13 PDT 2007
Update of /home/cvs/cvsroot/freeside/FS/bin
In directory wavetail:/tmp/cvs-serv7026/FS/bin
Modified Files:
freeside-upgrade
Log Message:
agent_custid bugfix (1746)
Index: freeside-upgrade
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/bin/freeside-upgrade,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- freeside-upgrade 1 Aug 2007 19:21:58 -0000 1.11
+++ freeside-upgrade 16 Aug 2007 16:19:10 -0000 1.12
@@ -39,10 +39,27 @@
$DBIx::DBSchema::Table::DEBUG = $DEBUG;
$DBIx::DBSchema::Index::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