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

(-)a/installer/data/mysql/updatedatabase.pl (-1 / +14 lines)
Lines 5369-5374 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
5369
    SetVersion($DBversion);
5369
    SetVersion($DBversion);
5370
}
5370
}
5371
5371
5372
$DBversion = '3.09.00.XXX';
5373
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
5374
	$dbh->do("ALTER TABLE `statistics` ADD `ccode` VARCHAR( 80 ) NULL ;");
5375
	$dbh->do("UPDATE statistics SET statistics.ccode = ( SELECT items.ccode FROM items WHERE statistics.itemnumber = items.itemnumber )");
5376
	$dbh->do("UPDATE statistics SET statistics.ccode = ( 
5377
	  SELECT deleteditems.ccode FROM deleteditems
5378
          WHERE statistics.itemnumber = deleteditems.itemnumber
5379
	  ) WHERE statistics.ccode IS NULL");
5380
	print "Upgrade done ( Added Category Code to Statistics table. )\n";
5381
    SetVersion ($DBversion);
5382
}
5372
5383
5373
=head1 FUNCTIONS
5384
=head1 FUNCTIONS
5374
5385
Lines 5389-5394 sub TableExists { Link Here
5389
5400
5390
=head2 DropAllForeignKeys($table)
5401
=head2 DropAllForeignKeys($table)
5391
5402
5403
5404
=item DropAllForeignKeys($table)
5405
5392
Drop all foreign keys of the table $table
5406
Drop all foreign keys of the table $table
5393
5407
5394
=cut
5408
=cut
5395
- 

Return to bug 4118