projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1293d13
)
agent_custid bugfix (1746)
author
jeff
<jeff>
Thu, 16 Aug 2007 16:19:10 +0000
(16:19 +0000)
committer
jeff
<jeff>
Thu, 16 Aug 2007 16:19:10 +0000
(16:19 +0000)
FS/bin/freeside-upgrade
patch
|
blob
|
history
diff --git
a/FS/bin/freeside-upgrade
b/FS/bin/freeside-upgrade
index
1155af0
..
9b95ec1
100755
(executable)
--- a/
FS/bin/freeside-upgrade
+++ b/
FS/bin/freeside-upgrade
@@
-39,10
+39,27
@@
$DBIx::DBSchema::DEBUG = $DEBUG;
$DBIx::DBSchema::Table::DEBUG = $DEBUG;
$DBIx::DBSchema::Index::DEBUG = $DEBUG;
$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 ) {
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 {
exit;
} else {
+ foreach my $statement ( @bugfix ) {
+ $dbh->do( $statement )
+ or die "Error: ". $dbh->errstr. "\n executing: $statement";
+ }
+
dbdef->update_schema( dbdef_dist, $dbh );
}
dbdef->update_schema( dbdef_dist, $dbh );
}