From c398dc859698bedf3cc84e92694ec81a954b370e Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Tue, 7 Sep 2021 15:26:30 +1200 Subject: [PATCH] Bug 6796: Updated schema files --- Koha/Schema/Result/Branch.pm | 15 +++++ Koha/Schema/Result/BranchHour.pm | 99 ++++++++++++++++++++++++++++++++ 2 files changed, 114 insertions(+) create mode 100644 Koha/Schema/Result/BranchHour.pm diff --git a/Koha/Schema/Result/Branch.pm b/Koha/Schema/Result/Branch.pm index b924c94f98e..ad719a45255 100644 --- a/Koha/Schema/Result/Branch.pm +++ b/Koha/Schema/Result/Branch.pm @@ -401,6 +401,21 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 branch_hours + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "branch_hours", + "Koha::Schema::Result::BranchHour", + { "foreign.branchcode" => "self.branchcode" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 branches_overdrive Type: might_have diff --git a/Koha/Schema/Result/BranchHour.pm b/Koha/Schema/Result/BranchHour.pm new file mode 100644 index 00000000000..12a90483a33 --- /dev/null +++ b/Koha/Schema/Result/BranchHour.pm @@ -0,0 +1,99 @@ +use utf8; +package Koha::Schema::Result::BranchHour; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::BranchHour + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("branch_hours"); + +=head1 ACCESSORS + +=head2 branchcode + + data_type: 'varchar' + is_foreign_key: 1 + is_nullable: 0 + size: 10 + +=head2 day + + data_type: 'integer' + default_value: 0 + is_nullable: 0 + +=head2 open_time + + data_type: 'time' + is_nullable: 1 + +=head2 close_time + + data_type: 'time' + is_nullable: 1 + +=cut + +__PACKAGE__->add_columns( + "branchcode", + { data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 10 }, + "day", + { data_type => "integer", default_value => 0, is_nullable => 0 }, + "open_time", + { data_type => "time", is_nullable => 1 }, + "close_time", + { data_type => "time", is_nullable => 1 }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("branchcode", "day"); + +=head1 RELATIONS + +=head2 branchcode + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "branchcode", + "Koha::Schema::Result::Branch", + { branchcode => "branchcode" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2021-09-07 15:26:05 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:IOwQ7WPWaPXJP+IFAbQoTg + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; -- 2.20.1