From 10a847737f25781592c0090a32fac81495d45d92 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Fri, 7 Apr 2023 16:30:36 +0000 Subject: [PATCH] Bug 16122: Add localuse column to items and deleteditems Signed-off-by: Christopher Brannon Signed-off-by: Emily Lamancusa Signed-off-by: Katrin Fischer Signed-off-by: Andrew Fuerste-Henry Signed-off-by: Andrew Fuerste Henry Signed-off-by: Martin Renvoize --- .../atomicupdate/bug_16122_atomicupdate.pl | 31 +++++++++++++++++++ installer/data/mysql/kohastructure.sql | 2 ++ 2 files changed, 33 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/bug_16122_atomicupdate.pl diff --git a/installer/data/mysql/atomicupdate/bug_16122_atomicupdate.pl b/installer/data/mysql/atomicupdate/bug_16122_atomicupdate.pl new file mode 100755 index 00000000000..4d63b2a0faa --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_16122_atomicupdate.pl @@ -0,0 +1,31 @@ +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'"; + } + }, + } diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 16310f0f449..0906c5be16b 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -2759,6 +2759,7 @@ CREATE TABLE `deleteditems` ( `coded_location_qualifier` varchar(10) DEFAULT NULL COMMENT 'coded location qualifier(MARC21 952$f)', `issues` smallint(6) DEFAULT 0 COMMENT 'number of times this item has been checked out', `renewals` smallint(6) DEFAULT NULL COMMENT 'number of times this item has been renewed', + `localuse` smallint(6) DEFAULT NULL COMMENT 'number of times this item has been recorded as localuse', `reserves` smallint(6) DEFAULT NULL COMMENT 'number of times this item has been placed on hold/reserved', `restricted` tinyint(1) DEFAULT NULL COMMENT 'authorized value defining use restrictions for this item (MARC21 952$5)', `itemnotes` longtext DEFAULT NULL COMMENT 'public notes on this item (MARC21 952$z)', @@ -4016,6 +4017,7 @@ CREATE TABLE `items` ( `coded_location_qualifier` varchar(10) DEFAULT NULL COMMENT 'coded location qualifier(MARC21 952$f)', `issues` smallint(6) DEFAULT 0 COMMENT 'number of times this item has been checked out/issued', `renewals` smallint(6) DEFAULT NULL COMMENT 'number of times this item has been renewed', + `localuse` smallint(6) DEFAULT NULL COMMENT 'number of times this item has been recorded as localuse', `reserves` smallint(6) DEFAULT NULL COMMENT 'number of times this item has been placed on hold/reserved', `restricted` tinyint(1) DEFAULT NULL COMMENT 'authorized value defining use restrictions for this item (MARC21 952$5)', `itemnotes` longtext DEFAULT NULL COMMENT 'public notes on this item (MARC21 952$z)', -- 2.44.0