From d37bff1873c2ea96fe7b53b51b60b65d6ec52d32 Mon Sep 17 00:00:00 2001 From: Agustin Moyano Date: Fri, 4 Dec 2020 18:47:30 -0300 Subject: [PATCH] Bug 23207: Add automatic_checkin column to itemtypes table installer/data/mysql/kohastructure.sql --- installer/data/mysql/atomicupdate/bug_23027.perl | 11 +++++++++++ installer/data/mysql/kohastructure.sql | 1 + 2 files changed, 12 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_23027.perl diff --git a/installer/data/mysql/atomicupdate/bug_23027.perl b/installer/data/mysql/atomicupdate/bug_23027.perl new file mode 100644 index 0000000000..5e7a57894c --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_23027.perl @@ -0,0 +1,11 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + if( !column_exists( 'itemtypes', 'automatic_checkin' ) ) { + $dbh->do(q{ + ALTER TABLE itemtypes ADD COLUMN `automatic_checkin` tinyint(1) NOT NULL DEFAULT 0 AFTER `searchcategory` -- 1 if automatic checkin is enabled for items of this type + }); + } + + # Always end with this (adjust the bug info) + NewVersion( $DBversion, 23027, "Add automatic_checkin to itemtypes table"); +} diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index ef3bff04b0..c6bb2adc27 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -943,6 +943,7 @@ CREATE TABLE `itemtypes` ( -- defines the item types 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 searchcategory varchar(80) default NULL, -- Group this item type with others with the same value on OPAC search options + `automatic_checkin` tinyint(1) NOT NULL DEFAULT 0, -- 1 if automatic checkin is enabled for items of this type PRIMARY KEY (`itemtype`), CONSTRAINT itemtypes_ibfk_1 FOREIGN KEY (parent_type) REFERENCES itemtypes(itemtype) ON UPDATE CASCADE ON DELETE CASCADE, UNIQUE KEY `itemtype` (`itemtype`) -- 2.25.0