From 46fe03540b7ac47e70f0b6141a23d933967cdd50 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Fri, 17 Jan 2020 12:04:07 +0000 Subject: [PATCH] Bug 23092: Add 'daterequested' to branchtransfers table --- .../data/mysql/atomicupdate/bug_23092.perl | 18 ++++++++++++++++++ installer/data/mysql/kohastructure.sql | 1 + 2 files changed, 19 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_23092.perl diff --git a/installer/data/mysql/atomicupdate/bug_23092.perl b/installer/data/mysql/atomicupdate/bug_23092.perl new file mode 100644 index 0000000000..a704bab866 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_23092.perl @@ -0,0 +1,18 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + + unless ( column_exists('branchtransfers', 'daterequested') ) { + $dbh->do( + qq{ + ALTER TABLE branchtransfers + ADD + `daterequested` timestamp NOT NULL default CURRENT_TIMESTAMP + AFTER + `itemnumber` + } + ); + } + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 23092 - Add 'daterequested' field to transfers table)\n"; +} diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 63af9e4d80..36be0bebc4 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -946,6 +946,7 @@ DROP TABLE IF EXISTS `branchtransfers`; CREATE TABLE `branchtransfers` ( -- information for items that are in transit between branches `branchtransfer_id` int(12) NOT NULL auto_increment, -- primary key `itemnumber` int(11) NOT NULL default 0, -- the itemnumber that it is in transit (items.itemnumber) + `daterequested` timestamp NOT NULL default CURRENT_TIMESTAMP, -- the date the transfer was requested `datesent` datetime default NULL, -- the date the transfer was initialized `frombranch` varchar(10) NOT NULL default '', -- the branch the transfer is coming from `datearrived` datetime default NULL, -- the date the transfer arrived at its destination -- 2.20.1