From 0707078676090dd8e0d3607964bbaa7df60d6b61 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 7 Nov 2024 11:33:30 +0000 Subject: [PATCH] Bug 38011: Schema update Signed-off-by: Martin Renvoize Signed-off-by: Jonathan Druart --- Koha/Schema/Result/Aqbookseller.pm | 19 +++++++++++++++++-- Koha/Schema/Result/Subscription.pm | 28 ++++++++++++++++++++++++---- 2 files changed, 41 insertions(+), 6 deletions(-) diff --git a/Koha/Schema/Result/Aqbookseller.pm b/Koha/Schema/Result/Aqbookseller.pm index f9ce48cae47..d1236a43b0b 100644 --- a/Koha/Schema/Result/Aqbookseller.pm +++ b/Koha/Schema/Result/Aqbookseller.pm @@ -494,6 +494,21 @@ __PACKAGE__->belongs_to( }, ); +=head2 subscriptions + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "subscriptions", + "Koha::Schema::Result::Subscription", + { "foreign.aqbooksellerid" => "self.id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 vendor_edi_accounts Type: has_many @@ -510,8 +525,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-06-30 09:54:35 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:xjeOqpcdN3Kb1wmLGDjzLg +# Created by DBIx::Class::Schema::Loader v0.07051 @ 2024-11-07 11:31:56 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:E6f6AyKIiLOJ/rFkNTZcUw __PACKAGE__->add_columns( '+active' => { is_boolean => 1 }, diff --git a/Koha/Schema/Result/Subscription.pm b/Koha/Schema/Result/Subscription.pm index cb5d1533f44..94f5cb8e441 100644 --- a/Koha/Schema/Result/Subscription.pm +++ b/Koha/Schema/Result/Subscription.pm @@ -59,7 +59,7 @@ start date for this subscription =head2 aqbooksellerid data_type: 'integer' - default_value: 0 + is_foreign_key: 1 is_nullable: 1 foreign key for aqbooksellers.id to link to the vendor @@ -353,7 +353,7 @@ __PACKAGE__->add_columns( "startdate", { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, "aqbooksellerid", - { data_type => "integer", default_value => 0, is_nullable => 1 }, + { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, "cost", { data_type => "integer", default_value => 0, is_nullable => 1 }, "aqbudgetid", @@ -450,6 +450,26 @@ __PACKAGE__->set_primary_key("subscriptionid"); =head1 RELATIONS +=head2 aqbooksellerid + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "aqbooksellerid", + "Koha::Schema::Result::Aqbookseller", + { id => "aqbooksellerid" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "CASCADE", + }, +); + =head2 aqorders Type: has_many @@ -566,8 +586,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-07-14 11:46:15 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:LICIiWzag365cUAq5OYD2A +# Created by DBIx::Class::Schema::Loader v0.07051 @ 2024-11-07 11:31:56 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:qd3CxnE91Zjvs8LXPEDV6Q __PACKAGE__->has_many( "additional_field_values", -- 2.34.1