From 80c13cfb31efd9aea67508c1203f1fe0bff9c8c0 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 29 Apr 2021 09:55:38 +0200 Subject: [PATCH] Bug 17202: DBIC schema changes Signed-off-by: Jonathan Druart --- Koha/Schema/Result/Collection.pm | 19 ++++++++++++-- Koha/Schema/Result/CollectionsTracking.pm | 31 ++++++++++++++++++----- 2 files changed, 42 insertions(+), 8 deletions(-) diff --git a/Koha/Schema/Result/Collection.pm b/Koha/Schema/Result/Collection.pm index 90d5809a3e..9c40fcd6be 100644 --- a/Koha/Schema/Result/Collection.pm +++ b/Koha/Schema/Result/Collection.pm @@ -118,9 +118,24 @@ __PACKAGE__->belongs_to( }, ); +=head2 collections_trackings -# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:bNonPwexORvzFUQlDKobEQ +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "collections_trackings", + "Koha::Schema::Result::CollectionsTracking", + { "foreign.colId" => "self.colId" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-04-29 07:54:20 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:le+rc9BRLaPAApAZSZrKRg # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/CollectionsTracking.pm b/Koha/Schema/Result/CollectionsTracking.pm index 4a55cbdf37..880a33d56e 100644 --- a/Koha/Schema/Result/CollectionsTracking.pm +++ b/Koha/Schema/Result/CollectionsTracking.pm @@ -34,6 +34,7 @@ __PACKAGE__->table("collections_tracking"); accessor: 'col_id' data_type: 'integer' default_value: 0 + is_foreign_key: 1 is_nullable: 0 collections.colId @@ -53,10 +54,11 @@ __PACKAGE__->add_columns( { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, "colId", { - accessor => "col_id", - data_type => "integer", - default_value => 0, - is_nullable => 0, + accessor => "col_id", + data_type => "integer", + default_value => 0, + is_foreign_key => 1, + is_nullable => 0, }, "itemnumber", { data_type => "integer", default_value => 0, is_nullable => 0 }, @@ -74,9 +76,26 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("collections_tracking_id"); +=head1 RELATIONS -# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-08-18 13:01:05 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:s8ZFSmMJt313bz3XdlhITQ +=head2 col + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "col", + "Koha::Schema::Result::Collection", + { colId => "colId" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-04-29 07:54:20 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:JcoZbVCFzYkwbGjyRlH5rA # You can replace this text with custom code or comments, and it will be preserved on regeneration -- 2.20.1