Bugzilla – Attachment 186785 Details for
Bug 40704
When item is deleted, title disappears from reading history creating a useless entry
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40704: DBIC schema changes
Bug-40704-DBIC-schema-changes.patch (text/plain), 4.60 KB, created by
Jonathan Druart
on 2025-09-23 11:00:00 UTC
(
hide
)
Description:
Bug 40704: DBIC schema changes
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2025-09-23 11:00:00 UTC
Size:
4.60 KB
patch
obsolete
>From 41a0f1cb3aeb90e370c7ce5ce3f7fdfa805a9843 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 23 Sep 2025 12:31:14 +0200 >Subject: [PATCH] Bug 40704: DBIC schema changes > >--- > Koha/Schema/Result/Deleteditem.pm | 28 +++++++++++++++++-- > Koha/Schema/Result/Item.pm | 14 ++++++++++ > Koha/Schema/Result/OldIssue.pm | 46 +++++++++++++++++++++++++++++-- > 3 files changed, 84 insertions(+), 4 deletions(-) > >diff --git a/Koha/Schema/Result/Deleteditem.pm b/Koha/Schema/Result/Deleteditem.pm >index 778432f2723..08a9a218909 100644 >--- a/Koha/Schema/Result/Deleteditem.pm >+++ b/Koha/Schema/Result/Deleteditem.pm >@@ -530,9 +530,33 @@ __PACKAGE__->add_columns( > > __PACKAGE__->set_primary_key("itemnumber"); > >+=head1 RELATIONS > >-# Created by DBIx::Class::Schema::Loader v0.07051 @ 2025-04-28 16:41:47 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:HKee88cG4WAK2dbWrPNrLg >+=head2 old_issues >+ >+Type: has_many >+ >+Related object: L<Koha::Schema::Result::OldIssue> >+ >+=cut >+ >+__PACKAGE__->has_many( >+ "old_issues", >+ "Koha::Schema::Result::OldIssue", >+ { "foreign.deleted_itemnumber" => "self.itemnumber" }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ >+ >+# Created by DBIx::Class::Schema::Loader v0.07051 @ 2025-09-23 09:02:14 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:O92pzALvFEWaHGLycrBNAw >+ >+__PACKAGE__->belongs_to( >+ "biblio", >+ "Koha::Schema::Result::Biblio", >+ { biblionumber => "biblionumber" }, >+ { is_deferrable => 1, on_delete => "SET NULL", on_update => "CASCADE" }, >+); > > __PACKAGE__->add_columns( > '+bookable' => { is_boolean => 1 }, >diff --git a/Koha/Schema/Result/Item.pm b/Koha/Schema/Result/Item.pm >index 83b361a1400..f2377b4ffc6 100644 >--- a/Koha/Schema/Result/Item.pm >+++ b/Koha/Schema/Result/Item.pm >@@ -1027,6 +1027,20 @@ __PACKAGE__->belongs_to( > }, > ); > >+__PACKAGE__->might_have( >+ "checkout", >+ "Koha::Schema::Result::Issue", >+ { "foreign.itemnumber" => "self.itemnumber" }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ >+__PACKAGE__->has_many( >+ "old_checkouts", >+ "Koha::Schema::Result::OldIssue", >+ { "foreign.itemnumber" => "self.itemnumber" }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ > __PACKAGE__->add_columns( > '+bookable' => { is_boolean => 1 }, > '+damaged' => { is_boolean => 0 }, >diff --git a/Koha/Schema/Result/OldIssue.pm b/Koha/Schema/Result/OldIssue.pm >index 4561f179fb2..9b26d8d568d 100644 >--- a/Koha/Schema/Result/OldIssue.pm >+++ b/Koha/Schema/Result/OldIssue.pm >@@ -54,6 +54,14 @@ foreign key, linking this to the borrowers table for the user who checked out th > > foreign key, linking this to the items table for the item that was checked out > >+=head2 deleted_itemnumber >+ >+ data_type: 'integer' >+ is_foreign_key: 1 >+ is_nullable: 1 >+ >+foreign key, linking this to the deleteditems table for the item that was checked out >+ > =head2 booking_id > > data_type: 'integer' >@@ -192,6 +200,8 @@ __PACKAGE__->add_columns( > { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, > "itemnumber", > { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, >+ "deleted_itemnumber", >+ { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, > "booking_id", > { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, > "date_due", >@@ -320,6 +330,26 @@ __PACKAGE__->belongs_to( > }, > ); > >+=head2 deleted_itemnumber >+ >+Type: belongs_to >+ >+Related object: L<Koha::Schema::Result::Deleteditem> >+ >+=cut >+ >+__PACKAGE__->belongs_to( >+ "deleted_itemnumber", >+ "Koha::Schema::Result::Deleteditem", >+ { itemnumber => "deleted_itemnumber" }, >+ { >+ is_deferrable => 1, >+ join_type => "LEFT", >+ on_delete => "SET NULL", >+ on_update => "SET NULL", >+ }, >+); >+ > =head2 issuer > > Type: belongs_to >@@ -361,8 +391,8 @@ __PACKAGE__->belongs_to( > ); > > >-# Created by DBIx::Class::Schema::Loader v0.07051 @ 2025-09-05 20:52:04 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:0g+Bdh4Fs1JdmeDEsAS0BA >+# Created by DBIx::Class::Schema::Loader v0.07051 @ 2025-09-23 09:02:14 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:2jKNbApUIjWoEvnNwr5CNQ > > __PACKAGE__->add_columns( > '+auto_renew' => { is_boolean => 1 }, >@@ -389,6 +419,18 @@ __PACKAGE__->belongs_to( > }, > ); > >+__PACKAGE__->belongs_to( >+ "deleted_item", >+ "Koha::Schema::Result::Deleteditem", >+ { itemnumber => "deleted_itemnumber" }, >+ { >+ is_deferrable => 1, >+ join_type => "LEFT", >+ on_delete => "SET NULL", >+ on_update => "SET NULL", >+ }, >+); >+ > __PACKAGE__->belongs_to( > "library", > "Koha::Schema::Result::Branch", >-- >2.34.1
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 40704
:
186717
|
186728
|
186784
| 186785 |
186786