@@ -, +, @@ --- Koha/Schema/Result/CourseItem.pm | 19 +++++++++++++++++-- Koha/Schema/Result/CourseReserve.pm | 22 +++++++++++++++++++--- 2 files changed, 36 insertions(+), 5 deletions(-) --- a/Koha/Schema/Result/CourseItem.pm +++ a/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 --- a/Koha/Schema/Result/CourseReserve.pm +++ a/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 --