From 01f49d7303acf5ec37ce45d469e3cca4c6ead26c Mon Sep 17 00:00:00 2001 From: Josef Moravec Date: Wed, 10 Oct 2018 14:24:52 +0000 Subject: [PATCH] Bug 21401: DO NOT PUSH - schema changes --- Koha/Schema/Result/Accountline.pm | 33 +++++++++++++++++++++++++++++++-- Koha/Schema/Result/Branch.pm | 19 +++++++++++++++++-- 2 files changed, 48 insertions(+), 4 deletions(-) diff --git a/Koha/Schema/Result/Accountline.pm b/Koha/Schema/Result/Accountline.pm index 378c14a..50cadcc 100644 --- a/Koha/Schema/Result/Accountline.pm +++ b/Koha/Schema/Result/Accountline.pm @@ -111,6 +111,13 @@ __PACKAGE__->table("accountlines"); data_type: 'integer' is_nullable: 1 +=head2 branchcode + + data_type: 'varchar' + is_foreign_key: 1 + is_nullable: 1 + size: 10 + =cut __PACKAGE__->add_columns( @@ -154,6 +161,8 @@ __PACKAGE__->add_columns( { data_type => "mediumtext", is_nullable => 1 }, "manager_id", { data_type => "integer", is_nullable => 1 }, + "branchcode", + { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 }, ); =head1 PRIMARY KEY @@ -215,6 +224,26 @@ __PACKAGE__->belongs_to( { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, ); +=head2 branchcode + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "branchcode", + "Koha::Schema::Result::Branch", + { branchcode => "branchcode" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "SET NULL", + on_update => "CASCADE", + }, +); + =head2 itemnumber Type: belongs_to @@ -236,8 +265,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-05-16 17:00:24 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:pygYYKxFDRLX97PyeUeLvg +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-10-10 14:24:08 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:PacL0dcS1HuKgdCg3bQa4w # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/Branch.pm b/Koha/Schema/Result/Branch.pm index 13fe183..92943d3 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 accountlines + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "accountlines", + "Koha::Schema::Result::Accountline", + { "foreign.branchcode" => "self.branchcode" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 aqbaskets Type: has_many @@ -662,8 +677,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-10-09 15:50:42 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:0yMUX1UukdV7eMol06JXTQ +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-10-10 14:24:08 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:nRmkJuB8V/vJNUW6/gP5dg # You can replace this text with custom code or comments, and it will be preserved on regeneration -- 2.1.4