From 126fb2ce752626159cdbabf298fd2b5db7b36a63 Mon Sep 17 00:00:00 2001 From: Josef Moravec Date: Mon, 24 Sep 2018 07:04:15 +0000 Subject: [PATCH] Bug 21401: Update schema --- Koha/Schema/Result/AccountOffset.pm | 33 +++++++++++++++++++++++++++++++-- Koha/Schema/Result/Branch.pm | 19 +++++++++++++++++-- 2 files changed, 48 insertions(+), 4 deletions(-) diff --git a/Koha/Schema/Result/AccountOffset.pm b/Koha/Schema/Result/AccountOffset.pm index 892c095..42d457c 100644 --- a/Koha/Schema/Result/AccountOffset.pm +++ b/Koha/Schema/Result/AccountOffset.pm @@ -61,6 +61,13 @@ __PACKAGE__->table("account_offsets"); default_value: current_timestamp is_nullable: 0 +=head2 transaction_library + + data_type: 'varchar' + is_foreign_key: 1 + is_nullable: 1 + size: 10 + =cut __PACKAGE__->add_columns( @@ -81,6 +88,8 @@ __PACKAGE__->add_columns( default_value => \"current_timestamp", is_nullable => 0, }, + "transaction_library", + { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 }, ); =head1 PRIMARY KEY @@ -137,6 +146,26 @@ __PACKAGE__->belongs_to( }, ); +=head2 transaction_library + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "transaction_library", + "Koha::Schema::Result::Branch", + { branchcode => "transaction_library" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "CASCADE", + on_update => "CASCADE", + }, +); + =head2 type Type: belongs_to @@ -153,8 +182,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-10-20 16:27:04 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:tPPrIug2c7PbDO7LCxCJAA +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-09-24 06:47:56 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:l4H08mo7riljgHp4ao3uzA # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/Branch.pm b/Koha/Schema/Result/Branch.pm index b85094b..4a2cf7a 100644 --- a/Koha/Schema/Result/Branch.pm +++ b/Koha/Schema/Result/Branch.pm @@ -211,6 +211,21 @@ __PACKAGE__->set_primary_key("branchcode"); =head1 RELATIONS +=head2 account_offsets + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "account_offsets", + "Koha::Schema::Result::AccountOffset", + { "foreign.transaction_library" => "self.branchcode" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 aqbaskets Type: has_many @@ -617,8 +632,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-09-06 16:28:49 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:N0tdcSAb4bMht/i0chipYQ +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-09-24 06:47:56 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:5gFVB/eeFmxQ65hgjr1ygQ # You can replace this text with custom code or comments, and it will be preserved on regeneration -- 2.1.4