@@ -, +, @@ --- .../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 --- a/installer/data/mysql/atomicupdate/bug_33262.pl +++ a/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'"; + }, +}; --- a/installer/data/mysql/kohastructure.sql +++ a/installer/data/mysql/kohastructure.sql @@ -659,6 +659,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', --