Bugzilla – Attachment 189566 Details for
Bug 41246
Deleting patron categories or libraries can leave orphaned rules in the overduerules table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41246: DBIC changes [DO NOT PUSH]
Bug-41246-DBIC-changes-DO-NOT-PUSH.patch (text/plain), 4.77 KB, created by
Lucas Gass (lukeg)
on 2025-11-13 15:05:58 UTC
(
hide
)
Description:
Bug 41246: DBIC changes [DO NOT PUSH]
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2025-11-13 15:05:58 UTC
Size:
4.77 KB
patch
obsolete
>From da6a7d5b63bc74a8102e79d59bf1278874f1495b Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Thu, 13 Nov 2025 15:05:17 +0000 >Subject: [PATCH] Bug 41246: DBIC changes [DO NOT PUSH] > >--- > Koha/Schema/Result/Branch.pm | 19 +++++++++-- > Koha/Schema/Result/Category.pm | 19 +++++++++-- > Koha/Schema/Result/Overduerule.pm | 52 ++++++++++++++++++++++++++++--- > 3 files changed, 82 insertions(+), 8 deletions(-) > >diff --git a/Koha/Schema/Result/Branch.pm b/Koha/Schema/Result/Branch.pm >index 787c0772195..74a2e93d334 100644 >--- a/Koha/Schema/Result/Branch.pm >+++ b/Koha/Schema/Result/Branch.pm >@@ -860,6 +860,21 @@ __PACKAGE__->has_many( > { cascade_copy => 0, cascade_delete => 0 }, > ); > >+=head2 overduerules >+ >+Type: has_many >+ >+Related object: L<Koha::Schema::Result::Overduerule> >+ >+=cut >+ >+__PACKAGE__->has_many( >+ "overduerules", >+ "Koha::Schema::Result::Overduerule", >+ { "foreign.branchcode" => "self.branchcode" }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ > =head2 problem_reports > > Type: has_many >@@ -996,8 +1011,8 @@ __PACKAGE__->has_many( > ); > > >-# Created by DBIx::Class::Schema::Loader v0.07051 @ 2024-05-03 13:13:25 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:HiH1QNlDqKcq9GeM85Pu0A >+# Created by DBIx::Class::Schema::Loader v0.07051 @ 2025-11-13 15:03:12 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:KGc+KpEDo/pAGumD8qZlaQ > > __PACKAGE__->has_many( > "additional_field_values", >diff --git a/Koha/Schema/Result/Category.pm b/Koha/Schema/Result/Category.pm >index 9cb9622295a..24b1c6f13e2 100644 >--- a/Koha/Schema/Result/Category.pm >+++ b/Koha/Schema/Result/Category.pm >@@ -409,9 +409,24 @@ __PACKAGE__->has_many( > { cascade_copy => 0, cascade_delete => 0 }, > ); > >+=head2 overduerules > >-# Created by DBIx::Class::Schema::Loader v0.07051 @ 2025-07-10 07:11:31 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ADt+iDjteg9Jb81L2FMIvg >+Type: has_many >+ >+Related object: L<Koha::Schema::Result::Overduerule> >+ >+=cut >+ >+__PACKAGE__->has_many( >+ "overduerules", >+ "Koha::Schema::Result::Overduerule", >+ { "foreign.categorycode" => "self.categorycode" }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ >+ >+# Created by DBIx::Class::Schema::Loader v0.07051 @ 2025-11-13 15:03:12 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:dbqrap0TqIsIGzB8DTLOLg > > # You can replace this text with custom code or comments, and it will be preserved on regeneration > >diff --git a/Koha/Schema/Result/Overduerule.pm b/Koha/Schema/Result/Overduerule.pm >index 85be1701a5a..d450fe29d29 100644 >--- a/Koha/Schema/Result/Overduerule.pm >+++ b/Koha/Schema/Result/Overduerule.pm >@@ -35,6 +35,7 @@ unique identifier for the overduerules > > data_type: 'varchar' > default_value: (empty string) >+ is_foreign_key: 1 > is_nullable: 0 > size: 10 > >@@ -44,6 +45,7 @@ foreign key from the branches table to define which branch this rule is for (if > > data_type: 'varchar' > default_value: (empty string) >+ is_foreign_key: 1 > is_nullable: 0 > size: 10 > >@@ -124,9 +126,21 @@ __PACKAGE__->add_columns( > "overduerules_id", > { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, > "branchcode", >- { data_type => "varchar", default_value => "", is_nullable => 0, size => 10 }, >+ { >+ data_type => "varchar", >+ default_value => "", >+ is_foreign_key => 1, >+ is_nullable => 0, >+ size => 10, >+ }, > "categorycode", >- { data_type => "varchar", default_value => "", is_nullable => 0, size => 10 }, >+ { >+ data_type => "varchar", >+ default_value => "", >+ is_foreign_key => 1, >+ is_nullable => 0, >+ size => 10, >+ }, > "delay1", > { data_type => "integer", is_nullable => 1 }, > "letter1", >@@ -177,6 +191,36 @@ __PACKAGE__->add_unique_constraint("overduerules_branch_cat", ["branchcode", "ca > > =head1 RELATIONS > >+=head2 branchcode >+ >+Type: belongs_to >+ >+Related object: L<Koha::Schema::Result::Branch> >+ >+=cut >+ >+__PACKAGE__->belongs_to( >+ "branchcode", >+ "Koha::Schema::Result::Branch", >+ { branchcode => "branchcode" }, >+ { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, >+); >+ >+=head2 categorycode >+ >+Type: belongs_to >+ >+Related object: L<Koha::Schema::Result::Category> >+ >+=cut >+ >+__PACKAGE__->belongs_to( >+ "categorycode", >+ "Koha::Schema::Result::Category", >+ { categorycode => "categorycode" }, >+ { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, >+); >+ > =head2 overduerules_transport_types > > Type: has_many >@@ -193,8 +237,8 @@ __PACKAGE__->has_many( > ); > > >-# Created by DBIx::Class::Schema::Loader v0.07051 @ 2025-05-06 16:22:12 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:/1ZL98jFwZ5PyG4sYSziiA >+# Created by DBIx::Class::Schema::Loader v0.07051 @ 2025-11-13 15:03:12 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:aMDpv7I3wxwcwuhe/gANOg > > __PACKAGE__->add_columns( > '+debarred1' => { 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 41246
:
189564
|
189565
| 189566