+
+ function do_cleanup()
+ {
+ global $db;
+
+ //remove obsolete and temporary columns.
+ // this have to be done here as db_import rearranges alter query order
+ $dropcol = array(
+ 'tax_groups' => array('tax_shipping'),
+ 'tax_group_items' => array('rate'),
+ 'budget_trans' => array('type', 'type_no', 'person_id', 'person_type_id', 'memo_'),
+ 'cust_branch' => array('contact_name', 'disable_trans'),
+ 'stock_moves' => array('discount_percent', 'visible', 'person_id'),
+ );
+
+ foreach($dropcol as $table => $columns)
+ foreach($columns as $col) {
+ if (db_query("ALTER TABLE `".TB_PREF."{$table}` DROP `$col`") == false) {
+ return $this->log_error(sprintf(_("Cannot drop column in %s table: %s"), $table, db_error_msg($db)));
+ }
+ }
+ return true;
+ }