Bugzilla – Attachment 150657 Details for
Bug 33262
When an ordered record is deleted, we lose all information on what was ordered
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33262: Add deleted_biblionumber column to aqorders table
Bug-33262-Add-deletedbiblionumber-column-to-aqorde.patch (text/plain), 3.96 KB, created by
Katrin Fischer
on 2023-05-04 13:12:16 UTC
(
hide
)
Description:
Bug 33262: Add deleted_biblionumber column to aqorders table
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2023-05-04 13:12:16 UTC
Size:
3.96 KB
patch
obsolete
>From 71a115221c9fdae2571193182bc9858e9b77ce88 Mon Sep 17 00:00:00 2001 >From: Katrin Fischer <katrin.fischer@bsz-bw.de> >Date: Thu, 4 May 2023 11:03:30 +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. >--- > 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 > >diff --git a/Koha/Schema/Result/Aqorder.pm b/Koha/Schema/Result/Aqorder.pm >index d11d6d12fe..1a71858661 100644 >--- a/Koha/Schema/Result/Aqorder.pm >+++ b/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</aqorder_users> -> 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", >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 50796112dc..ee32e9d33c 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/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', >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 33262
:
150647
|
150657
|
150658
|
150659
|
150660
|
150661
|
150662
|
150663
|
150664
|
150680
|
150681
|
150682
|
150683
|
150684
|
150702
|
150703
|
150704
|
150705
|
150706
|
150734
|
150735
|
150736
|
150737
|
150738