From 2541ce4555f9c754343a767fff4b16258c13f5d3 Mon Sep 17 00:00:00 2001 From: Alex Sassmannshausen Date: Thu, 13 Oct 2016 10:05:46 +0200 Subject: [PATCH] DO NOT PUSH: Moar Housebound Schema files. * Koha/Schema/Result/Borrower.pm: New method. * Koha/Schema/Result/HouseboundRole.pm: New file. https://bugs.koha-community.org/show_bug.cgi?id=5670 Signed-off-by: Claire Gravely Signed-off-by: Kyle M Hall --- Koha/Schema/Result/Borrower.pm | 68 +++++++++++++++++++-- Koha/Schema/Result/HouseboundRole.pm | 90 ++++++++++++++++++++++++++++ 2 files changed, 154 insertions(+), 4 deletions(-) create mode 100644 Koha/Schema/Result/HouseboundRole.pm diff --git a/Koha/Schema/Result/Borrower.pm b/Koha/Schema/Result/Borrower.pm index de70e74022..b656a8c708 100644 --- a/Koha/Schema/Result/Borrower.pm +++ b/Koha/Schema/Result/Borrower.pm @@ -419,7 +419,7 @@ __PACKAGE__->table("borrowers"); data_type: 'timestamp' datetime_undef_if_invalid: 1 default_value: current_timestamp - is_nullable: 0 + is_nullable: 1 =head2 lastseen @@ -608,7 +608,7 @@ __PACKAGE__->add_columns( data_type => "timestamp", datetime_undef_if_invalid => 1, default_value => \"current_timestamp", - is_nullable => 0, + is_nullable => 1, }, "lastseen", { @@ -898,6 +898,66 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 housebound_profile + +Type: might_have + +Related object: L + +=cut + +__PACKAGE__->might_have( + "housebound_profile", + "Koha::Schema::Result::HouseboundProfile", + { "foreign.borrowernumber" => "self.borrowernumber" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + +=head2 housebound_role + +Type: might_have + +Related object: L + +=cut + +__PACKAGE__->might_have( + "housebound_role", + "Koha::Schema::Result::HouseboundRole", + { "foreign.borrowernumber_id" => "self.borrowernumber" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + +=head2 housebound_visit_chooser_brwnumbers + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "housebound_visit_chooser_brwnumbers", + "Koha::Schema::Result::HouseboundVisit", + { "foreign.chooser_brwnumber" => "self.borrowernumber" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + +=head2 housebound_visit_deliverer_brwnumbers + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "housebound_visit_deliverer_brwnumbers", + "Koha::Schema::Result::HouseboundVisit", + { "foreign.deliverer_brwnumber" => "self.borrowernumber" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 issues Type: has_many @@ -1244,8 +1304,8 @@ Composing rels: L -> ordernumber __PACKAGE__->many_to_many("ordernumbers", "aqorder_users", "ordernumber"); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-09-13 17:32:29 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:23Yg0CXG1z8f5Bx92JCVoQ +# Created by DBIx::Class::Schema::Loader v0.07039 @ 2016-10-13 07:29:58 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:gTAVqirjg5ZckpVtRTXHOQ __PACKAGE__->belongs_to( "guarantor", diff --git a/Koha/Schema/Result/HouseboundRole.pm b/Koha/Schema/Result/HouseboundRole.pm new file mode 100644 index 0000000000..d6abe4997a --- /dev/null +++ b/Koha/Schema/Result/HouseboundRole.pm @@ -0,0 +1,90 @@ +use utf8; +package Koha::Schema::Result::HouseboundRole; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::HouseboundRole + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("housebound_role"); + +=head1 ACCESSORS + +=head2 borrowernumber_id + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +=head2 housebound_chooser + + data_type: 'tinyint' + default_value: 0 + is_nullable: 0 + +=head2 housebound_deliverer + + data_type: 'tinyint' + default_value: 0 + is_nullable: 0 + +=cut + +__PACKAGE__->add_columns( + "borrowernumber_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "housebound_chooser", + { data_type => "tinyint", default_value => 0, is_nullable => 0 }, + "housebound_deliverer", + { data_type => "tinyint", default_value => 0, is_nullable => 0 }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("borrowernumber_id"); + +=head1 RELATIONS + +=head2 borrowernumber + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "borrowernumber", + "Koha::Schema::Result::Borrower", + { borrowernumber => "borrowernumber_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07039 @ 2016-10-13 07:29:58 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:oRdlsug404i4vErycF4bgg + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; -- 2.39.5