@@ -, +, @@ --- installer/data/mysql/atomicupdate/bug_26057.perl | 13 +++++++++++++ installer/data/mysql/kohastructure.sql | 2 ++ 2 files changed, 15 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_26057.perl --- a/installer/data/mysql/atomicupdate/bug_26057.perl +++ a/installer/data/mysql/atomicupdate/bug_26057.perl @@ -0,0 +1,13 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + + if( !column_exists( 'branchtransfers', 'datecancelled' ) ) { + $dbh->do( "ALTER TABLE `branchtransfers` ADD COLUMN `datecancelled` datetime default NULL AFTER `datearrived`" ); + } + + if( !column_exists( 'branchtransfers', 'cancellation_reason' ) ) { + $dbh->do( "ALTER TABLE `branchtransfers` ADD COLUMN `cancellation_reason` ENUM('Manual', 'StockrotationAdvance', 'StockrotationRepatriation', 'ReturnToHome', 'ReturnToHolding', 'RotatingCollection', 'Reserve', 'LostReserve', 'CancelReserve') DEFAULT NULL AFTER `reason`" ); + } + + NewVersion( $DBversion, 26057, "Add datecancelled field to branchtransfers"); +} --- a/installer/data/mysql/kohastructure.sql +++ a/installer/data/mysql/kohastructure.sql @@ -1526,9 +1526,11 @@ CREATE TABLE `branchtransfers` ( `datesent` datetime DEFAULT NULL COMMENT 'the date the transfer was initialized', `frombranch` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'the branch the transfer is coming from', `datearrived` datetime DEFAULT NULL COMMENT 'the date the transfer arrived at its destination', + `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') COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'what triggered the transfer', + `cancellation_reason` ENUM('Manual', 'StockrotationAdvance', 'StockrotationRepatriation', 'ReturnToHome', 'ReturnToHolding', 'RotatingCollection', 'Reserve', 'LostReserve', 'CancelReserve') default NULL COMMENT 'what triggered the transfer cancellation', PRIMARY KEY (`branchtransfer_id`), KEY `frombranch` (`frombranch`), KEY `tobranch` (`tobranch`), --