From 2605aebfa769ce9055e1ed67a365a3ee1ff45799 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 17 May 2021 17:14:04 +0100 Subject: [PATCH] Bug 28294: Add 'WrongTransfer' to transfer reason enum This patch adds the 'WrongTransfer' value to the 'reason' enum in the branchtransfers table. This is so we can use it as a reason for the subsequent transfer when a trainsfer is triggered by a checkin at an incorrect branch after transfer has been initiated. Signed-off-by: Victor Grousset/tuxayo --- .../data/mysql/atomicupdate/bug_28294.perl | 28 +++++++++++++++++++ installer/data/mysql/kohastructure.sql | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 installer/data/mysql/atomicupdate/bug_28294.perl diff --git a/installer/data/mysql/atomicupdate/bug_28294.perl b/installer/data/mysql/atomicupdate/bug_28294.perl new file mode 100644 index 0000000000..63889d8e86 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_28294.perl @@ -0,0 +1,28 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + + # Add 'WrongTransfer' to branchtransfers cancellation_reason enum + $dbh->do( + q{ + ALTER TABLE + `branchtransfers` + MODIFY COLUMN + `reason` enum( + 'Manual', + 'StockrotationAdvance', + 'StockrotationRepatriation', + 'ReturnToHome', + 'ReturnToHolding', + 'RotatingCollection', + 'Reserve', + 'LostReserve', + 'CancelReserve', + 'TransferCancellation', + 'WrongTransfer' + ) + AFTER `comments` + } + ); + + NewVersion( $DBversion, 28294, "Add 'WrongTransfer' to branchtransfers.reason enum"); +} diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 4411ae7604..c0c032d848 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -1554,7 +1554,7 @@ CREATE TABLE `branchtransfers` ( `datecancelled` datetime DEFAULT NULL COMMENT 'the date the transfer was cancelled', `tobranch` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'the branch the transfer was going to', `comments` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'any comments related to the transfer', - `reason` enum('Manual','StockrotationAdvance','StockrotationRepatriation','ReturnToHome','ReturnToHolding','RotatingCollection','Reserve','LostReserve','CancelReserve','TransferCancellation') COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'what triggered the transfer', + `reason` enum('Manual','StockrotationAdvance','StockrotationRepatriation','ReturnToHome','ReturnToHolding','RotatingCollection','Reserve','LostReserve','CancelReserve','TransferCancellation','WrongTransfer') COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'what triggered the transfer', `cancellation_reason` enum('Manual','StockrotationAdvance','StockrotationRepatriation','ReturnToHome','ReturnToHolding','RotatingCollection','Reserve','LostReserve','CancelReserve','ItemLost','WrongTransfer') COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'what triggered the transfer cancellation', PRIMARY KEY (`branchtransfer_id`), KEY `frombranch` (`frombranch`), -- 2.20.1