From 80813bab1549a52ca171c720295739a733fa3995 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Fri, 11 Nov 2022 08:52:41 -0300 Subject: [PATCH] Bug 32162: DBIC schema Signed-off-by: Tomas Cohen Arazi --- Koha/Schema/Result/ErmAgreement.pm | 14 ++++++++++++-- Koha/Schema/Result/ErmEholdingsPackage.pm | 14 ++++++++++++-- .../Schema/Result/ErmEholdingsPackagesAgreement.pm | 13 ++++--------- 3 files changed, 28 insertions(+), 13 deletions(-) diff --git a/Koha/Schema/Result/ErmAgreement.pm b/Koha/Schema/Result/ErmAgreement.pm index 18fc028b9b..643f6189c1 100644 --- a/Koha/Schema/Result/ErmAgreement.pm +++ b/Koha/Schema/Result/ErmAgreement.pm @@ -256,9 +256,19 @@ __PACKAGE__->belongs_to( }, ); +=head2 packages -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-11-01 07:44:13 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:rdLbabpHCgb4l88Gmgst+g +Type: many_to_many + +Composing rels: L -> package + +=cut + +__PACKAGE__->many_to_many("packages", "erm_eholdings_packages_agreements", "package"); + + +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-11-11 11:52:09 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:N93LnvdKirtuV6BSrTGzVg __PACKAGE__->add_columns( '+is_perpetual' => { is_boolean => 1 } diff --git a/Koha/Schema/Result/ErmEholdingsPackage.pm b/Koha/Schema/Result/ErmEholdingsPackage.pm index 9221fee3c9..847f2685bb 100644 --- a/Koha/Schema/Result/ErmEholdingsPackage.pm +++ b/Koha/Schema/Result/ErmEholdingsPackage.pm @@ -187,9 +187,19 @@ __PACKAGE__->belongs_to( }, ); +=head2 agreements -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-10-19 09:25:48 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:KbZxONSm/pxXvUFi3PuZiQ +Type: many_to_many + +Composing rels: L -> agreement + +=cut + +__PACKAGE__->many_to_many("agreements", "erm_eholdings_packages_agreements", "agreement"); + + +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-11-11 11:52:09 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:3YA6xOwdLHDLoZnQJNk8eQ sub koha_object_class { 'Koha::ERM::EHoldings::Package'; diff --git a/Koha/Schema/Result/ErmEholdingsPackagesAgreement.pm b/Koha/Schema/Result/ErmEholdingsPackagesAgreement.pm index e8f15b8496..fd10e73afa 100644 --- a/Koha/Schema/Result/ErmEholdingsPackagesAgreement.pm +++ b/Koha/Schema/Result/ErmEholdingsPackagesAgreement.pm @@ -48,9 +48,7 @@ __PACKAGE__->add_columns( { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, ); -=head1 UNIQUE CONSTRAINTS - -=head2 C +=head1 PRIMARY KEY =over 4 @@ -62,10 +60,7 @@ __PACKAGE__->add_columns( =cut -__PACKAGE__->add_unique_constraint( - "erm_eholdings_packages_agreements_uniq", - ["package_id", "agreement_id"], -); +__PACKAGE__->set_primary_key("package_id", "agreement_id"); =head1 RELATIONS @@ -100,8 +95,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-07-20 08:58:20 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:OfIIIupuz76wN2HDac5fng +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-11-11 11:52:09 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:3nCckFzWVD8oZCG6eoljxw sub koha_object_class { 'Koha::ERM::Package::Agreement'; -- 2.39.5