From da6a7d5b63bc74a8102e79d59bf1278874f1495b Mon Sep 17 00:00:00 2001 From: Lucas Gass 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 + +=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 + +=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 + +=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 + +=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