fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2011-02-24 04:09 am

[dw-free] acctcode_promo table has outrageously long varchar field

[commit: http://hg.dwscoalition.org/dw-free/rev/b79f5e330c01]

http://bugs.dwscoalition.org/show_bug.cgi?id=3530

Fix absurdly long varchar definition.

Patch by [personal profile] exor674.

Files modified:
  • bin/upgrading/update-db-general.pl
--------------------------------------------------------------------------------
diff -r e17770214bbf -r b79f5e330c01 bin/upgrading/update-db-general.pl
--- a/bin/upgrading/update-db-general.pl	Wed Feb 23 20:23:30 2011 +0800
+++ b/bin/upgrading/update-db-general.pl	Thu Feb 24 12:08:50 2011 +0800
@@ -3920,7 +3920,7 @@ EOF
     }
 
     unless ( column_type( 'acctcode_promo', 'paid_class' ) ) {
-        do_alter( 'acctcode_promo', "ALTER TABLE acctcode_promo ADD COLUMN paid_class varchar(10000)" );
+        do_alter( 'acctcode_promo', "ALTER TABLE acctcode_promo ADD COLUMN paid_class varchar(100)" );
     }
 
     unless ( column_type( 'acctcode_promo', 'paid_months' ) ) {
@@ -3947,6 +3947,9 @@ EOF
         set_dbnote( "init_vgift_counts", 1 );
     }
 
+    unless ( column_type( 'acctcode_promo', 'paid_class' ) =~ /^\Qvarchar(100)\E/ ) {
+        do_alter( 'acctcode_promo', "ALTER TABLE acctcode_promo MODIFY COLUMN paid_class varchar(100)" );
+    }
 });
 
 
--------------------------------------------------------------------------------