don't return an error about changing the cust_main record to the user as a payment...
[freeside.git] / FS / bin / freeside-upgrade
index 3882ffb..97c704c 100755 (executable)
@@ -41,9 +41,9 @@ reload_dbdef($dbdef_file);
 warn "Upgrade startup completed in ". (time-$start). " seconds\n"; # if $DEBUG;
 $start = time;
 
-$DBIx::DBSchema::DEBUG = $DEBUG;
-$DBIx::DBSchema::Table::DEBUG = $DEBUG;
-$DBIx::DBSchema::Index::DEBUG = $DEBUG;
+#$DBIx::DBSchema::DEBUG = $DEBUG;
+#$DBIx::DBSchema::Table::DEBUG = $DEBUG;
+#$DBIx::DBSchema::Index::DEBUG = $DEBUG;
 
 my @bugfix = ();
 
@@ -60,14 +60,19 @@ if (dbdef->table('cust_main')->column('agent_custid') && ! $opt_s) {
 #from 1.3 to 1.4... if not, it needs to be hooked into -upgrade here or
 #you'll lose all the part_svc settings it migrates to part_svc_column
 
-my @statements =
+my @statements = dbdef->sql_update_schema( dbdef_dist(datasrc),
+                                           $dbh,
+                                           { 'nullify_default' => 1, },
+                                         );
+
+@statements = 
   grep { $_ !~ /^CREATE +INDEX +h_queue/i } #useless, holds up queue insertion
-       dbdef->sql_update_schema( dbdef_dist(datasrc), $dbh );
+       @statements;
 
 unless ( driver_name =~ /^mysql/i ) {
   #not necessary under non-mysql, takes forever on big db
   @statements =
-    grep { $_ !~ /^ *ALTER +TABLE +h_queue +ALTER +COLUMN +job +TYPE +varchar\(512\) *$/ }
+    grep { $_ !~ /^ *ALTER +TABLE +h_queue +ALTER +COLUMN +job +TYPE +varchar\(512\) *$/i }
          @statements;
 }
 
@@ -77,6 +82,7 @@ if ( $DRY_RUN ) {
   exit;
 } else {
   foreach my $statement ( @bugfix, @statements ) {
+    warn "$statement\n";
     $dbh->do( $statement )
       or die "Error: ". $dbh->errstr. "\n executing: $statement";
   }