From bf53a7e5035862176ff275df4cd632cb25ff1968 Mon Sep 17 00:00:00 2001 From: Nick Date: Sat, 21 Sep 2019 02:38:00 +0000 Subject: [PATCH] Bug 21946: DO NOT PUSH - Schema updates Signed-off-by: Lisette Scheer --- Koha/Schema/Result/Itemtype.pm | 48 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/Koha/Schema/Result/Itemtype.pm b/Koha/Schema/Result/Itemtype.pm index 073c527b7b..c2f6adf2ce 100644 --- a/Koha/Schema/Result/Itemtype.pm +++ b/Koha/Schema/Result/Itemtype.pm @@ -30,6 +30,13 @@ __PACKAGE__->table("itemtypes"); is_nullable: 0 size: 10 +=head2 parent_type + + data_type: 'varchar' + is_foreign_key: 1 + is_nullable: 1 + size: 10 + =head2 description data_type: 'longtext' @@ -117,6 +124,8 @@ __PACKAGE__->table("itemtypes"); __PACKAGE__->add_columns( "itemtype", { data_type => "varchar", default_value => "", is_nullable => 0, size => 10 }, + "parent_type", + { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 }, "description", { data_type => "longtext", is_nullable => 1 }, "rentalcharge", @@ -181,6 +190,21 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 itemtypes + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "itemtypes", + "Koha::Schema::Result::Itemtype", + { "foreign.parent_type" => "self.itemtype" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 itemtypes_branches Type: has_many @@ -211,6 +235,26 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 parent_type + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "parent_type", + "Koha::Schema::Result::Itemtype", + { itemtype => "parent_type" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "CASCADE", + on_update => "CASCADE", + }, +); + =head2 reserves Type: has_many @@ -227,8 +271,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07048 @ 2019-07-04 04:56:48 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Qo6jabJSQGeYJ542ebSJfg +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-09-21 02:35:28 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:TB3xxE+zR4PcJtR3FYMZoQ # Use the ItemtypeLocalization view to create the join on localization our $LANGUAGE; -- 2.11.0