Koha/installer/data/mysql/db_revs/231200028.pl
Katrin Fischer 0ff70e0b0c
Bug 16122: DBRev 23.12.00.028
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-04-26 14:15:03 +02:00

33 lines
1.2 KiB
Perl
Executable file

use Modern::Perl;
return {
bug_number => "16122",
description => "Add localuse column to items table and deleted items table",
up => sub {
my ($args) = @_;
my ( $dbh, $out ) = @$args{qw(dbh out)};
if ( !column_exists( 'items', 'localuse' ) ) {
$dbh->do(
q{
ALTER TABLE items
ADD COLUMN localuse smallint(6) NULL DEFAULT NULL
COMMENT "item's local use count"
AFTER renewals
}
);
say $out "Added column 'items.localuse'";
}
if ( !column_exists( 'deleteditems', 'localuse' ) ) {
$dbh->do(
q{
ALTER TABLE deleteditems
ADD COLUMN localuse smallint(6) NULL DEFAULT NULL
COMMENT "deleteditems local use count"
AFTER renewals
}
);
say $out "Added column 'deleteditems.localuse'";
}
say $out
"You may use the new /misc/maintenance/update_localuse_from_statistics.pl script to populate the new field from the existing statistics data";
},
}