From 120574705bcdb9ca7a77c21a1512b6b6e95c3868 Mon Sep 17 00:00:00 2001 From: Alex Buckley Date: Thu, 21 May 2020 23:19:23 +0000 Subject: [PATCH] Bug 25560: Database and installer changes -- Adds boolean flag itemtypes.updatenotforloan Sponsored-By: Waikato Institute of Technology, NZ Signed-off-by: David Nind Signed-off-by: Nick Clemens --- ...ug_25560-add_updatenotforloan_to_itemtypes.pl | 16 ++++++++++++++++ installer/data/mysql/kohastructure.sql | 1 + 2 files changed, 17 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/bug_25560-add_updatenotforloan_to_itemtypes.pl diff --git a/installer/data/mysql/atomicupdate/bug_25560-add_updatenotforloan_to_itemtypes.pl b/installer/data/mysql/atomicupdate/bug_25560-add_updatenotforloan_to_itemtypes.pl new file mode 100755 index 0000000000..e551d021bc --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_25560-add_updatenotforloan_to_itemtypes.pl @@ -0,0 +1,16 @@ +use Modern::Perl; + +return { + bug_number => "25560", + description => "Adding new column 'itemtypes.updatenotforloan'", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + + if( !column_exists( 'itemtypes', 'updatenotforloan' ) ) { + $dbh->do(q{ + ALTER TABLE itemtypes ADD COLUMN `updatenotforloan` TINYINT(1) NOT NULL DEFAULT 1 AFTER `hideinopac` + }); + } + }, +}; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 9d2e286c17..e4947d190b 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -3180,6 +3180,7 @@ CREATE TABLE `itemtypes` ( `checkinmsgtype` char(16) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'message' COMMENT 'type (CSS class) for the checkinmsg, can be ''alert'' or ''message''', `sip_media_type` varchar(3) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'SIP2 protocol media type for this itemtype', `hideinopac` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Hide the item type from the search options in OPAC', + `updatenotforloan` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'Enable this item type to be altered by the UpdateNotForLoanStatusOnCheckin system preference', `searchcategory` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Group this item type with others with the same value on OPAC search options', `automatic_checkin` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'If automatic checkin is enabled for items of this type', PRIMARY KEY (`itemtype`), -- 2.30.2