Bugzilla – Attachment 185517 Details for
Bug 40665
Add booking_id field to issues to link checkouts to bookings that were fulfilled by them
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[DO NOT PUSH] Bug 40665: DBIC
DO-NOT-PUSH-Bug-40665-DBIC.patch (text/plain), 5.41 KB, created by
Paul Derscheid
on 2025-08-18 15:48:09 UTC
(
hide
)
Description:
[DO NOT PUSH] Bug 40665: DBIC
Filename:
MIME Type:
Creator:
Paul Derscheid
Created:
2025-08-18 15:48:09 UTC
Size:
5.41 KB
patch
obsolete
>From 6fbd76a844cd30a2c06239ec1cf9393cd5fd4c7b Mon Sep 17 00:00:00 2001 >From: Paul Derscheid <paul.derscheid@lmscloud.de> >Date: Mon, 18 Aug 2025 15:40:44 +0000 >Subject: [PATCH] [DO NOT PUSH] Bug 40665: DBIC > >--- > Koha/Schema/Result/Booking.pm | 34 ++++++++++++++++++++++++++++++++-- > Koha/Schema/Result/Issue.pm | 34 ++++++++++++++++++++++++++++++++-- > Koha/Schema/Result/OldIssue.pm | 34 ++++++++++++++++++++++++++++++++-- > 3 files changed, 96 insertions(+), 6 deletions(-) > >diff --git a/Koha/Schema/Result/Booking.pm b/Koha/Schema/Result/Booking.pm >index 2231dbf19a3..c970b2b7951 100644 >--- a/Koha/Schema/Result/Booking.pm >+++ b/Koha/Schema/Result/Booking.pm >@@ -206,6 +206,21 @@ __PACKAGE__->belongs_to( > { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, > ); > >+=head2 issues >+ >+Type: has_many >+ >+Related object: L<Koha::Schema::Result::Issue> >+ >+=cut >+ >+__PACKAGE__->has_many( >+ "issues", >+ "Koha::Schema::Result::Issue", >+ { "foreign.booking_id" => "self.booking_id" }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ > =head2 item > > Type: belongs_to >@@ -226,6 +241,21 @@ __PACKAGE__->belongs_to( > }, > ); > >+=head2 old_issues >+ >+Type: has_many >+ >+Related object: L<Koha::Schema::Result::OldIssue> >+ >+=cut >+ >+__PACKAGE__->has_many( >+ "old_issues", >+ "Koha::Schema::Result::OldIssue", >+ { "foreign.booking_id" => "self.booking_id" }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ > =head2 patron > > Type: belongs_to >@@ -257,8 +287,8 @@ __PACKAGE__->belongs_to( > ); > > >-# Created by DBIx::Class::Schema::Loader v0.07051 @ 2024-10-24 16:23:05 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:kTR2kwiwY2PnjU1E0P+CMQ >+# Created by DBIx::Class::Schema::Loader v0.07051 @ 2025-08-18 12:37:32 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:uIijqCqLZybCZwvedr+hgg > > > # You can replace this text with custom code or comments, and it will be preserved on regeneration >diff --git a/Koha/Schema/Result/Issue.pm b/Koha/Schema/Result/Issue.pm >index f71dd508826..dd836252cce 100644 >--- a/Koha/Schema/Result/Issue.pm >+++ b/Koha/Schema/Result/Issue.pm >@@ -55,6 +55,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 booking_id >+ >+ data_type: 'integer' >+ is_foreign_key: 1 >+ is_nullable: 1 >+ >+foreign key linking this checkout to the booking it fulfills >+ > =head2 date_due > > data_type: 'datetime' >@@ -185,6 +193,8 @@ __PACKAGE__->add_columns( > { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, > "itemnumber", > { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, >+ "booking_id", >+ { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, > "date_due", > { > data_type => "datetime", >@@ -285,6 +295,26 @@ __PACKAGE__->has_many( > { cascade_copy => 0, cascade_delete => 0 }, > ); > >+=head2 booking >+ >+Type: belongs_to >+ >+Related object: L<Koha::Schema::Result::Booking> >+ >+=cut >+ >+__PACKAGE__->belongs_to( >+ "booking", >+ "Koha::Schema::Result::Booking", >+ { booking_id => "booking_id" }, >+ { >+ is_deferrable => 1, >+ join_type => "LEFT", >+ on_delete => "SET NULL", >+ on_update => "CASCADE", >+ }, >+); >+ > =head2 borrowernumber > > Type: belongs_to >@@ -336,8 +366,8 @@ __PACKAGE__->belongs_to( > ); > > >-# Created by DBIx::Class::Schema::Loader v0.07051 @ 2025-05-06 16:22:12 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:sCGlwnT9B7Mn1k80Gme6hw >+# Created by DBIx::Class::Schema::Loader v0.07051 @ 2025-08-18 12:37:32 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jConlZUBDEOqoZxF/KXTtg > > __PACKAGE__->add_columns( > '+auto_renew' => { is_boolean => 1 }, >diff --git a/Koha/Schema/Result/OldIssue.pm b/Koha/Schema/Result/OldIssue.pm >index 870922d86f6..2d046ed4f6b 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 booking_id >+ >+ data_type: 'integer' >+ is_foreign_key: 1 >+ is_nullable: 1 >+ >+foreign key linking this checkout to the booking it fulfilled >+ > =head2 date_due > > data_type: 'datetime' >@@ -184,6 +192,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 }, >+ "booking_id", >+ { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, > "date_due", > { > data_type => "datetime", >@@ -270,6 +280,26 @@ __PACKAGE__->has_many( > { cascade_copy => 0, cascade_delete => 0 }, > ); > >+=head2 booking >+ >+Type: belongs_to >+ >+Related object: L<Koha::Schema::Result::Booking> >+ >+=cut >+ >+__PACKAGE__->belongs_to( >+ "booking", >+ "Koha::Schema::Result::Booking", >+ { booking_id => "booking_id" }, >+ { >+ is_deferrable => 1, >+ join_type => "LEFT", >+ on_delete => "SET NULL", >+ on_update => "CASCADE", >+ }, >+); >+ > =head2 borrowernumber > > Type: belongs_to >@@ -331,8 +361,8 @@ __PACKAGE__->belongs_to( > ); > > >-# Created by DBIx::Class::Schema::Loader v0.07051 @ 2025-05-06 16:22:12 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:bO+nRkR4QDXrb5wmEOz9mw >+# Created by DBIx::Class::Schema::Loader v0.07051 @ 2025-08-18 12:37:32 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:0bxRaYxSPgxrcbVn6+F6Tg > > __PACKAGE__->add_columns( > '+auto_renew' => { is_boolean => 1 }, >-- >2.39.5
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 40665
:
185516
|
185517
|
185518
|
185519
|
185520
|
185895
|
185896
|
185897
|
185898
|
185899
|
186250
|
186369
|
187589