From 94862d38b6c5c39c5b9c716440ed40a19cb119a9 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.updatenotforloanstatusoncheckin Sponsored-By: Waikato Institute of Technology, NZ Signed-off-by: David Nind --- .../bug_25560-add_boolean_updatenotforloanstatusoncheckin.perl | 9 +++++++++ installer/data/mysql/kohastructure.sql | 1 + 2 files changed, 10 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_25560-add_boolean_updatenotforloanstatusoncheckin.perl diff --git a/installer/data/mysql/atomicupdate/bug_25560-add_boolean_updatenotforloanstatusoncheckin.perl b/installer/data/mysql/atomicupdate/bug_25560-add_boolean_updatenotforloanstatusoncheckin.perl new file mode 100644 index 0000000000..7b2f76da80 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_25560-add_boolean_updatenotforloanstatusoncheckin.perl @@ -0,0 +1,9 @@ +$DBversion = 'XXX'; +if( CheckVersion( $DBversion ) ) { + + if( !column_exists( 'itemtypes', 'updatenotforloanstatusoncheckin' ) ) { + $dbh->do(q{ ALTER TABLE itemtypes ADD COLUMN updatenotforloanstatusoncheckin TINYINT(1) NOT NULL DEFAULT 1 AFTER hideinopac }); + } + + NewVersion( $DBversion, 25560, "Add updatenotforloanstatusoncheckin boolean flag to itemtypestable"); +} diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 397dd2f3c3..0762fdc76d 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -916,6 +916,7 @@ CREATE TABLE `itemtypes` ( -- defines the item types checkinmsgtype CHAR(16) DEFAULT 'message' NOT NULL, -- type (CSS class) for the checkinmsg, can be "alert" or "message" sip_media_type VARCHAR(3) DEFAULT NULL, -- SIP2 protocol media type for this itemtype hideinopac tinyint(1) NOT NULL DEFAULT 0, -- Hide the item type from the search options in OPAC + updatenotforloanstatusoncheckin tinyint(1) NOT NULL DEFAULT 1, -- Enable the itemtype to be altered by the UpdateNotForLoanStatusOnCheckin system preference searchcategory varchar(80) default NULL, -- Group this item type with others with the same value on OPAC search options PRIMARY KEY (`itemtype`), CONSTRAINT itemtypes_ibfk_1 FOREIGN KEY (parent_type) REFERENCES itemtypes(itemtype) ON UPDATE CASCADE ON DELETE CASCADE, -- 2.11.0