@@ -, +, @@ --- Koha/Schema/Result/Aqorder.pm | 13 ++++++++++-- .../data/mysql/atomicupdate/bug_33262.pl | 20 +++++++++++++++++++ installer/data/mysql/kohastructure.sql | 1 + 3 files changed, 32 insertions(+), 2 deletions(-) create mode 100755 installer/data/mysql/atomicupdate/bug_33262.pl --- a/Koha/Schema/Result/Aqorder.pm +++ a/Koha/Schema/Result/Aqorder.pm @@ -39,6 +39,13 @@ primary key and unique identifier assigned by Koha to each line links the order to the biblio being ordered (biblio.biblionumber) +=head2 deleted_biblionumber + + data_type: 'integer' + is_nullable: 1 + +links the order to the deleted bibliographic record deletedbiblio.biblionumber) + =head2 entrydate data_type: 'date' @@ -438,6 +445,8 @@ __PACKAGE__->add_columns( { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, "biblionumber", { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, + "deleted_biblionumber", + { data_type => "integer", is_nullable => 1 }, "entrydate", { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, "quantity", @@ -805,8 +814,8 @@ Composing rels: L -> borrowernumber __PACKAGE__->many_to_many("borrowernumbers", "aqorder_users", "borrowernumber"); -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-03-06 16:45:06 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:7vMNLDNO0/Bpng9sBFyyBg +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-05-04 11:17:35 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:VtBQdGGCN86D4CWZLMZX+g __PACKAGE__->belongs_to( "basket", --- 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', --