View | Details | Raw Unified | Return to bug 4118
Collapse All | Expand All

(-)a/installer/data/mysql/updatedatabase.pl (-1 / +12 lines)
Lines 3398-3403 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
3398
    SetVersion ($DBversion);
3398
    SetVersion ($DBversion);
3399
}
3399
}
3400
3400
3401
$DBversion = '3.01.00.113';
3402
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
3403
	$dbh->do("ALTER TABLE `statistics` ADD `ccode` VARCHAR( 80 ) NULL ;");
3404
	$dbh->do("UPDATE statistics SET statistics.ccode = ( SELECT items.ccode FROM items WHERE statistics.itemnumber = items.itemnumber )");
3405
	$dbh->do("UPDATE statistics SET statistics.ccode = ( 
3406
	  SELECT deleteditems.ccode FROM deleteditems
3407
          WHERE statistics.itemnumber = deleteditems.itemnumber
3408
	  ) WHERE statistics.ccode IS NULL");
3409
	print "Upgrade done ( Added Category Code to Statistics table. )\n";
3410
    SetVersion ($DBversion);
3411
}
3412
3401
=item DropAllForeignKeys($table)
3413
=item DropAllForeignKeys($table)
3402
3414
3403
  Drop all foreign keys of the table $table
3415
  Drop all foreign keys of the table $table
3404
- 

Return to bug 4118