From 16464ef65688f8566db38766698d25b6df1d063e Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Thu, 4 May 2023 13:23:31 +0000 Subject: [PATCH] Bug 33262: Add deleted_biblionumber column to aqorders table This adds a new column deleted_biblionumber to the aqorders table. This will allow us to store the biblionumber of a deleted record, so we will still be able to tell what has been ordered once the record is deleted. Signed-off-by: David Nind Signed-off-by: Nick Clemens Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 0cf7687e833986d95ce9fa49bdb33252944fbbea) Signed-off-by: Martin Renvoize --- .../data/mysql/atomicupdate/bug_33262.pl | 20 +++++++++++++++++++ installer/data/mysql/kohastructure.sql | 1 + 2 files changed, 21 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/bug_33262.pl diff --git a/installer/data/mysql/atomicupdate/bug_33262.pl b/installer/data/mysql/atomicupdate/bug_33262.pl new file mode 100755 index 0000000000..b570526193 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_33262.pl @@ -0,0 +1,20 @@ +use Modern::Perl; + +return { + bug_number => "33262", + description => "Store biblionumber of deleted record in acquisition orders", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + if ( !column_exists( 'aqorders', 'deleted_biblionumber' ) ) { + + $dbh->do( + q{ + ALTER TABLE `aqorders` + ADD COLUMN `deleted_biblionumber` int(11) NULL DEFAULT NULL COMMENT 'links the order to the deleted bibliographic record (deletedbiblio.biblionumber)' AFTER biblionumber + } + ); + } + say $out "Added column 'aqorders.deleted_biblionumber'"; + }, +}; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index cf3cd2bb7c..550ee47adf 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -642,6 +642,7 @@ DROP TABLE IF EXISTS `aqorders`; CREATE TABLE `aqorders` ( `ordernumber` int(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key and unique identifier assigned by Koha to each line', `biblionumber` int(11) DEFAULT NULL COMMENT 'links the order to the biblio being ordered (biblio.biblionumber)', + `deleted_biblionumber` int(11) DEFAULT NULL COMMENT 'links the order to the deleted bibliographic record (deletedbiblio.biblionumber)', `entrydate` date DEFAULT NULL COMMENT 'the date the bib was added to the basket', `quantity` smallint(6) DEFAULT NULL COMMENT 'the quantity ordered', `currency` varchar(10) DEFAULT NULL COMMENT 'the currency used for the purchase', -- 2.39.5