From ca089aa9f2a417f480453bc90985486caf09b32a 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 | 4 +-- 2 files changed, 30 insertions(+), 2 deletions(-) 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 3fa09947f0..291908bc9e 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -1528,8 +1528,8 @@ 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', - `cancellation_reason` ENUM('Manual', 'StockrotationAdvance', 'StockrotationRepatriation', 'ReturnToHome', 'ReturnToHolding', 'RotatingCollection', 'Reserve', 'LostReserve', 'CancelReserve', 'ItemLost', 'WrongTransfer') default NULL COMMENT 'what triggered the transfer cancellation', + `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') default NULL COMMENT 'what triggered the transfer cancellation', PRIMARY KEY (`branchtransfer_id`), KEY `frombranch` (`frombranch`), KEY `tobranch` (`tobranch`), -- 2.31.1