From 6c73dce1f0a0309cdb4897b2b6d3ad86c6543e2b Mon Sep 17 00:00:00 2001 From: Agustin Moyano Date: Wed, 10 Jun 2020 16:13:35 -0300 Subject: [PATCH] Bug 19889: Add exclude_from_local_holds_priority columns to item, deleteditems and categories tables Sponsored-by: Cooperative Information Network (CIN) --- .../data/mysql/atomicupdate/bug-19889.perl | 22 +++++++++++++++++++ installer/data/mysql/kohastructure.sql | 3 +++ 2 files changed, 25 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug-19889.perl diff --git a/installer/data/mysql/atomicupdate/bug-19889.perl b/installer/data/mysql/atomicupdate/bug-19889.perl new file mode 100644 index 0000000000..99c395af7d --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug-19889.perl @@ -0,0 +1,22 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + if( !column_exists( 'items', 'exclude_from_local_holds_priority' ) ) { + $dbh->do(q{ + ALTER TABLE `items` ADD COLUMN `exclude_from_local_holds_priority` tinyint(1) default NULL AFTER `new_status` -- Exclude this item from local holds priority + }); + } + + if( !column_exists( 'deleteditems', 'exclude_from_local_holds_priority' ) ) { + $dbh->do(q{ + ALTER TABLE `deleteditems` ADD COLUMN `exclude_from_local_holds_priority` tinyint(1) default NULL AFTER `new_status` -- Exclude this item from local holds priority + }); + } + + if( !column_exists( 'categories', 'exclude_from_local_holds_priority' ) ) { + $dbh->do(q{ + ALTER TABLE `categories` ADD COLUMN `exclude_from_local_holds_priority` tinyint(1) default NULL AFTER `change_password` -- Exclude patrons of this category from local holds priority + }); + } + # Always end with this (adjust the bug info) + NewVersion( $DBversion, 19889, "Add exclude_from_local_holds_priority column to items, deleteditems and categories tables"); +} diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 4f6a9c399d..a7c4ce67da 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -325,6 +325,7 @@ CREATE TABLE `categories` ( -- this table shows information related to Koha patr `checkprevcheckout` varchar(7) NOT NULL default 'inherit', -- produce a warning for this patron category if this item has previously been checked out to this patron if 'yes', not if 'no', defer to syspref setting if 'inherit'. `reset_password` TINYINT(1) NULL DEFAULT NULL, -- if patrons of this category can do the password reset flow, `change_password` TINYINT(1) NULL DEFAULT NULL, -- if patrons of this category can change their passwords in the OAPC + `exclude_from_local_holds_priority` tinyint(1) default NULL, -- Exclude patrons of this category from local holds priority PRIMARY KEY (`categorycode`), UNIQUE KEY `categorycode` (`categorycode`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; @@ -662,6 +663,7 @@ CREATE TABLE `deleteditems` ( `copynumber` varchar(32) default NULL, -- copy number (MARC21 952$t) `stocknumber` varchar(32) default NULL, -- inventory number (MARC21 952$i) `new_status` VARCHAR(32) DEFAULT NULL, -- 'new' value, you can put whatever free-text information. This field is intented to be managed by the automatic_item_modification_by_age cronjob. + `exclude_from_local_holds_priority` tinyint(1) default NULL, -- Exclude this item from local holds priority PRIMARY KEY (`itemnumber`), KEY `delitembarcodeidx` (`barcode`), KEY `delitemstocknumberidx` (`stocknumber`), @@ -867,6 +869,7 @@ CREATE TABLE `items` ( -- holdings/item information `copynumber` varchar(32) default NULL, -- copy number (MARC21 952$t) `stocknumber` varchar(32) default NULL, -- inventory number (MARC21 952$i) `new_status` VARCHAR(32) DEFAULT NULL, -- 'new' value, you can put whatever free-text information. This field is intented to be managed by the automatic_item_modification_by_age cronjob. + `exclude_from_local_holds_priority` tinyint(1) default NULL, -- Exclude this item from local holds priority PRIMARY KEY (`itemnumber`), UNIQUE KEY `itembarcodeidx` (`barcode`), KEY `itemstocknumberidx` (`stocknumber`), -- 2.25.0