From 8fe6d1e0ccc25bd8e873dc2e27e7af6aadf4fa27 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 16 Jan 2020 15:25:34 +0000 Subject: [PATCH] Bug 24298: Add return enums to branchstransfer triggers --- .../data/mysql/atomicupdate/bug_24298.perl | 23 +++++++++++++++++++ installer/data/mysql/kohastructure.sql | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 installer/data/mysql/atomicupdate/bug_24298.perl diff --git a/installer/data/mysql/atomicupdate/bug_24298.perl b/installer/data/mysql/atomicupdate/bug_24298.perl new file mode 100644 index 0000000000..766bb04a08 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_24298.perl @@ -0,0 +1,23 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + + # Add stockrotation states to trigger enum + $dbh->do( + qq{ + ALTER TABLE + `branchtransfers` + MODIFY COLUMN + `trigger` enum( + 'MANUAL', + 'StockrotationAdvance', + 'StockrotationRepatriation', + 'ReturnToHome', + 'ReturnToHolding' + ) + AFTER `comments` + } + ); + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 24296 - Add 'return' triggers to branchtransfers enum)\n"; +} diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index cf6187de21..23a17ed77a 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -951,7 +951,7 @@ CREATE TABLE `branchtransfers` ( -- information for items that are in transit be `datearrived` datetime default NULL, -- the date the transfer arrived at its destination `tobranch` varchar(10) NOT NULL default '', -- the branch the transfer was going to `comments` LONGTEXT, -- any comments related to the transfer - `trigger` ENUM('MANUAL', 'StockrotationAdvance', 'StockrotationRepatriation'), -- what triggered the transfer + `trigger` ENUM('MANUAL', 'StockrotationAdvance', 'StockrotationRepatriation', 'ReturnToHome', 'ReturnToHolding'), -- what triggered the transfer PRIMARY KEY (`branchtransfer_id`), KEY `frombranch` (`frombranch`), KEY `tobranch` (`tobranch`), -- 2.20.1