From d0a61ed7373b634b29d649f4528f403410cb8f6c Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Mon, 18 May 2020 13:32:21 -0400 Subject: [PATCH] Bug 25534: Update database Signed-off-by: Andrew Fuerste-Henry Signed-off-by: Rebecca Coert --- .../mysql/atomicupdate/cancellation_reason.perl | 16 ++++++++++++++++ installer/data/mysql/kohastructure.sql | 2 ++ 2 files changed, 18 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/cancellation_reason.perl diff --git a/installer/data/mysql/atomicupdate/cancellation_reason.perl b/installer/data/mysql/atomicupdate/cancellation_reason.perl new file mode 100644 index 0000000000..cd73a1803b --- /dev/null +++ b/installer/data/mysql/atomicupdate/cancellation_reason.perl @@ -0,0 +1,16 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if ( CheckVersion( $DBversion ) ) { + if ( !column_exists( 'reserves', 'cancellation_reason' ) ) { + $dbh->do(q{ + ALTER TABLE reserves ADD COLUMN `cancellation_reason` varchar(80) default NULL AFTER cancellationdate; + }); + } + + if ( !column_exists( 'old_reserves', 'cancellation_reason' ) ) { + $dbh->do(q{ + ALTER TABLE old_reserves ADD COLUMN `cancellation_reason` varchar(80) default NULL AFTER cancellationdate; + }); + } + + NewVersion( $DBversion, 25534, "Add ability to send an email specifying a reason when canceling a hold"); +} diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 35c643fa38..f1905573f7 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -1760,6 +1760,7 @@ CREATE TABLE `reserves` ( -- information related to holds/reserves in Koha `notificationdate` date default NULL, -- currently unused `reminderdate` date default NULL, -- currently unused `cancellationdate` date default NULL, -- the date this hold was cancelled + `cancellation_reason` varchar(80) default NULL, -- optional authorised value CANCELLATION_REASON `reservenotes` LONGTEXT, -- notes related to this hold `priority` smallint(6) NOT NULL DEFAULT 1, -- where in the queue the patron sits `found` varchar(1) default NULL, -- a one letter code defining what the status is of the hold is after it has been confirmed @@ -1800,6 +1801,7 @@ CREATE TABLE `old_reserves` ( -- this table holds all holds/reserves that have b `notificationdate` date default NULL, -- currently unused `reminderdate` date default NULL, -- currently unused `cancellationdate` date default NULL, -- the date this hold was cancelled + `cancellation_reason` varchar(80) default NULL, -- optional authorised value CANCELLATION_REASON `reservenotes` LONGTEXT, -- notes related to this hold `priority` smallint(6) NOT NULL DEFAULT 1, -- where in the queue the patron sits `found` varchar(1) default NULL, -- a one letter code defining what the status is of the hold is after it has been confirmed -- 2.24.1 (Apple Git-126)