@@ -, +, @@ item, deleteditems and categories tables --- .../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 --- a/installer/data/mysql/atomicupdate/bug-19889.perl +++ a/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"); +} --- a/installer/data/mysql/kohastructure.sql +++ a/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`), --