[freeside-commits] freeside/FS/bin freeside-upgrade,1.42,1.43
Erik Levinson
levinse at wavetail.420.am
Fri Jul 8 19:59:51 PDT 2011
Update of /home/cvs/cvsroot/freeside/FS/bin
In directory wavetail.420.am:/tmp/cvs-serv29558/FS/bin
Modified Files:
freeside-upgrade
Log Message:
custom fields, RT11714
Index: freeside-upgrade
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/bin/freeside-upgrade,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -w -d -r1.42 -r1.43
--- freeside-upgrade 29 Mar 2011 01:04:31 -0000 1.42
+++ freeside-upgrade 9 Jul 2011 02:59:49 -0000 1.43
@@ -127,6 +127,19 @@
{ 'nullify_default' => 1, },
);
+#### NEW CUSTOM FIELDS (prevent columns from being dropped by upgrade)
+my $cfsth = $dbh->prepare("SELECT * FROM part_virtual_field")
+ or die $dbh->errstr;
+$cfsth->execute or die $cfsth->errstr;
+my $cf;
+# likely a very inefficient implementation of this
+while ( $cf = $cfsth->fetchrow_hashref ) {
+ my $tbl = $cf->{'dbtable'};
+ my $name = $cf->{'name'};
+ @statements = grep { $_ !~ /^\s*ALTER\s+TABLE\s+$tbl\s+DROP\s+COLUMN\s+cf_$name\s*$/i }
+ @statements;
+}
+
@statements =
grep { $_ !~ /^CREATE +INDEX +h_queue/i } #useless, holds up queue insertion
@statements;
More information about the freeside-commits
mailing list