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

(-)a/installer/data/mysql/updatedatabase.pl (-3 / +2 lines)
Lines 5538-5550 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
5538
5538
5539
$DBversion = '3.09.00.XXX';
5539
$DBversion = '3.09.00.XXX';
5540
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
5540
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
5541
	$dbh->do("ALTER TABLE `statistics` ADD `ccode` VARCHAR( 80 ) NULL ;");
5541
	$dbh->do("ALTER TABLE statistics ADD COLUMN ccode VARCHAR ( 10 ) NULL AFTER associatedborrower");
5542
	$dbh->do("UPDATE statistics SET statistics.ccode = ( SELECT items.ccode FROM items WHERE statistics.itemnumber = items.itemnumber )");
5542
	$dbh->do("UPDATE statistics SET statistics.ccode = ( SELECT items.ccode FROM items WHERE statistics.itemnumber = items.itemnumber )");
5543
	$dbh->do("UPDATE statistics SET statistics.ccode = (
5543
	$dbh->do("UPDATE statistics SET statistics.ccode = (
5544
	  SELECT deleteditems.ccode FROM deleteditems
5544
	  SELECT deleteditems.ccode FROM deleteditems
5545
          WHERE statistics.itemnumber = deleteditems.itemnumber
5545
          WHERE statistics.itemnumber = deleteditems.itemnumber
5546
	  ) WHERE statistics.ccode IS NULL");
5546
	  ) WHERE statistics.ccode IS NULL");
5547
	print "Upgrade done ( Added Category Code to Statistics table. )\n";
5547
	print "Upgrade done ( Added Collection Code to Statistics table. )\n";
5548
    SetVersion ($DBversion);
5548
    SetVersion ($DBversion);
5549
}
5549
}
5550
5550
5551
- 

Return to bug 4118