From ce2ea94f304b8e3a0c5fa6c967c2b864e5d0e7bc Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Wed, 2 Sep 2015 09:49:41 -0300 Subject: [PATCH] Bug 14205: (RM followup) DBIx updates Signed-off-by: Tomas Cohen Arazi --- Koha/Schema/Result/CourseItem.pm | 19 +++++++++++++++++-- Koha/Schema/Result/CourseReserve.pm | 22 +++++++++++++++++++--- 2 files changed, 36 insertions(+), 5 deletions(-) diff --git a/Koha/Schema/Result/CourseItem.pm b/Koha/Schema/Result/CourseItem.pm index a37263dd17..1766302449 100644 --- a/Koha/Schema/Result/CourseItem.pm +++ b/Koha/Schema/Result/CourseItem.pm @@ -133,6 +133,21 @@ __PACKAGE__->add_unique_constraint("itemnumber", ["itemnumber"]); =head1 RELATIONS +=head2 course_reserves + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "course_reserves", + "Koha::Schema::Result::CourseReserve", + { "foreign.ci_id" => "self.ci_id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 holdingbranch Type: belongs_to @@ -169,8 +184,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:iVWZfUWcPfrLdLdvjyvbow +# Created by DBIx::Class::Schema::Loader v0.07039 @ 2015-09-02 09:46:54 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:g5lEeHNvnM4KIb6AJUxDOw # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/CourseReserve.pm b/Koha/Schema/Result/CourseReserve.pm index 9cfdfab7bc..ed930c93f5 100644 --- a/Koha/Schema/Result/CourseReserve.pm +++ b/Koha/Schema/Result/CourseReserve.pm @@ -38,6 +38,7 @@ __PACKAGE__->table("course_reserves"); =head2 ci_id data_type: 'integer' + is_foreign_key: 1 is_nullable: 0 =head2 staff_note @@ -65,7 +66,7 @@ __PACKAGE__->add_columns( "course_id", { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, "ci_id", - { data_type => "integer", is_nullable => 0 }, + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, "staff_note", { data_type => "mediumtext", is_nullable => 1 }, "public_note", @@ -109,6 +110,21 @@ __PACKAGE__->add_unique_constraint("pseudo_key", ["course_id", "ci_id"]); =head1 RELATIONS +=head2 ci + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "ci", + "Koha::Schema::Result::CourseItem", + { ci_id => "ci_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + =head2 course Type: belongs_to @@ -125,8 +141,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-07-11 09:26:55 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:SSTJhsNOuUlxr/CsDs08pQ +# Created by DBIx::Class::Schema::Loader v0.07039 @ 2015-09-02 09:46:54 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:4RbSgGvSM5wH1jpE+deLlA # You can replace this text with custom content, and it will be preserved on regeneration -- 2.39.5