Remove constants from compiled layers on dev servers, to reduce warning 
spam.

        Patch by kareila. 

diffs (20 lines):

diff -r 9d6bd9196dac -r ecd40b302765 bin/upgrading/update-db-general.pl
--- a/bin/upgrading/update-db-general.pl        Fri Oct 22 23:18:04 2010 +0800
+++ b/bin/upgrading/update-db-general.pl        Sat Oct 23 00:00:09 2010 +0800
@@ -3864,6 +3864,16 @@ EOF
     unless ( column_type( 'acctcode_promo', 'paid_months' ) ) {
         do_alter( 'acctcode_promo', "ALTER TABLE acctcode_promo ADD COLUMN 
paid_months tinyint unsigned" );
     }
+
+    if ( $LJ::IS_DEV_SERVER ) {
+        # strip constant definitions from user layers
+        if ( table_relevant( "s2compiled2" ) && ! check_dbnote( 
"no_layer_constants" ) ) {
+            my $uses = q{ 'use constant VTABLE => 0;\nuse constant STATIC => 
1;\nuse constant PROPS => 2;\n' };
+            do_sql( "UPDATE s2compiled2 SET compdata = 
REPLACE(compdata,$uses,'')" );
+            set_dbnote( "no_layer_constants", 1 );
+        }
+    }
+
 });
 
 
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog

Reply via email to