From d96089f281e4d9fdfe8d28eada5ce0b70fc0b465 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Thu, 23 Apr 2020 17:37:43 +0000 Subject: [PATCH] Bug 19532: Updated schema files --- Koha/Schema/Result/Biblio.pm | 19 ++- Koha/Schema/Result/Borrower.pm | 19 ++- Koha/Schema/Result/Branch.pm | 19 ++- Koha/Schema/Result/Branchtransfer.pm | 8 +- Koha/Schema/Result/Item.pm | 19 ++- Koha/Schema/Result/Recall.pm | 273 +++++++++++++++++++++++++++++++++++ 6 files changed, 346 insertions(+), 11 deletions(-) create mode 100644 Koha/Schema/Result/Recall.pm diff --git a/Koha/Schema/Result/Biblio.pm b/Koha/Schema/Result/Biblio.pm index 806faf87ad7..c4b4529ee85 100644 --- a/Koha/Schema/Result/Biblio.pm +++ b/Koha/Schema/Result/Biblio.pm @@ -315,6 +315,21 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 recalls + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "recalls", + "Koha::Schema::Result::Recall", + { "foreign.biblionumber" => "self.biblionumber" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 reserves Type: has_many @@ -451,8 +466,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-04-17 09:15:51 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:p2SIq565zPyE3ZUkSuXyBA +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-04-23 17:21:08 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:0rCmoGALe1M4WdpgG7fI5A __PACKAGE__->has_one( diff --git a/Koha/Schema/Result/Borrower.pm b/Koha/Schema/Result/Borrower.pm index 997a7c40751..37cb1216830 100644 --- a/Koha/Schema/Result/Borrower.pm +++ b/Koha/Schema/Result/Borrower.pm @@ -1372,6 +1372,21 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 recalls + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "recalls", + "Koha::Schema::Result::Recall", + { "foreign.borrowernumber" => "self.borrowernumber" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 reserves Type: has_many @@ -1703,8 +1718,8 @@ Composing rels: L -> ordernumber __PACKAGE__->many_to_many("ordernumbers", "aqorder_users", "ordernumber"); -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-05-04 07:27:55 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:JMF49k5YH+pq7U3kVSgQRQ +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-04-23 17:21:08 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:X9D1px4woQ6BN0XdMA4/dA __PACKAGE__->add_columns( '+anonymized' => { is_boolean => 1 }, diff --git a/Koha/Schema/Result/Branch.pm b/Koha/Schema/Result/Branch.pm index 478c06fc0e8..87763a30abe 100644 --- a/Koha/Schema/Result/Branch.pm +++ b/Koha/Schema/Result/Branch.pm @@ -683,6 +683,21 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 recalls + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "recalls", + "Koha::Schema::Result::Recall", + { "foreign.branchcode" => "self.branchcode" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 repeatable_holidays Type: has_many @@ -789,8 +804,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-04-29 16:09:25 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9f0Crr57ffdoe8syXgawng +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-04-23 17:21:08 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Bd0gKmCuHeaz/Uvfl2z8yw __PACKAGE__->add_columns( '+pickup_location' => { is_boolean => 1 } diff --git a/Koha/Schema/Result/Branchtransfer.pm b/Koha/Schema/Result/Branchtransfer.pm index a2f63b81c01..fc757905e53 100644 --- a/Koha/Schema/Result/Branchtransfer.pm +++ b/Koha/Schema/Result/Branchtransfer.pm @@ -72,7 +72,7 @@ __PACKAGE__->table("branchtransfers"); =head2 reason data_type: 'enum' - extra: {list => ["Manual","StockrotationAdvance","StockrotationRepatriation","ReturnToHome","ReturnToHolding","RotatingCollection","Reserve","LostReserve","CancelReserve"]} + extra: {list => ["Manual","StockrotationAdvance","StockrotationRepatriation","ReturnToHome","ReturnToHolding","RotatingCollection","Reserve","LostReserve","CancelReserve","Recall","CancelRecall"]} is_nullable: 1 =cut @@ -131,6 +131,8 @@ __PACKAGE__->add_columns( "Reserve", "LostReserve", "CancelReserve", + "Recall", + "CancelRecall", ], }, is_nullable => 1, @@ -197,8 +199,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-03-20 11:24:33 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:50FpCj6vWH5O8MThCy/1hA +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-04-23 17:21:08 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:z7g/QoficyyTLbfujBX0UQ sub koha_object_class { 'Koha::Item::Transfer'; diff --git a/Koha/Schema/Result/Item.pm b/Koha/Schema/Result/Item.pm index cb77d96ee08..4ca3f79bc62 100644 --- a/Koha/Schema/Result/Item.pm +++ b/Koha/Schema/Result/Item.pm @@ -671,6 +671,21 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 recalls + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "recalls", + "Koha::Schema::Result::Recall", + { "foreign.itemnumber" => "self.itemnumber" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 reserves Type: has_many @@ -747,8 +762,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-04-27 10:38:13 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:IpI7wRweeZCbCeU1LhZbRQ +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-04-23 17:21:08 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:iUKMdJe0hpbyO51SvBc5vg __PACKAGE__->belongs_to( biblioitem => "Koha::Schema::Result::Biblioitem", "biblioitemnumber" ); diff --git a/Koha/Schema/Result/Recall.pm b/Koha/Schema/Result/Recall.pm new file mode 100644 index 00000000000..46c327bde72 --- /dev/null +++ b/Koha/Schema/Result/Recall.pm @@ -0,0 +1,273 @@ +use utf8; +package Koha::Schema::Result::Recall; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::Recall + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("recalls"); + +=head1 ACCESSORS + +=head2 recall_id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + +=head2 borrowernumber + + data_type: 'integer' + default_value: 0 + is_foreign_key: 1 + is_nullable: 0 + +=head2 recalldate + + data_type: 'datetime' + datetime_undef_if_invalid: 1 + is_nullable: 1 + +=head2 biblionumber + + data_type: 'integer' + default_value: 0 + is_foreign_key: 1 + is_nullable: 0 + +=head2 branchcode + + data_type: 'varchar' + is_foreign_key: 1 + is_nullable: 1 + size: 10 + +=head2 cancellationdate + + data_type: 'datetime' + datetime_undef_if_invalid: 1 + is_nullable: 1 + +=head2 recallnotes + + data_type: 'mediumtext' + is_nullable: 1 + +=head2 priority + + data_type: 'smallint' + is_nullable: 1 + +=head2 status + + data_type: 'varchar' + is_nullable: 1 + size: 1 + +=head2 timestamp + + data_type: 'timestamp' + datetime_undef_if_invalid: 1 + default_value: current_timestamp + is_nullable: 0 + +=head2 itemnumber + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 1 + +=head2 waitingdate + + data_type: 'datetime' + datetime_undef_if_invalid: 1 + is_nullable: 1 + +=head2 expirationdate + + data_type: 'datetime' + datetime_undef_if_invalid: 1 + is_nullable: 1 + +=head2 old + + data_type: 'tinyint' + is_nullable: 1 + +=head2 item_level_recall + + data_type: 'tinyint' + default_value: 0 + is_nullable: 0 + +=cut + +__PACKAGE__->add_columns( + "recall_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "borrowernumber", + { + data_type => "integer", + default_value => 0, + is_foreign_key => 1, + is_nullable => 0, + }, + "recalldate", + { + data_type => "datetime", + datetime_undef_if_invalid => 1, + is_nullable => 1, + }, + "biblionumber", + { + data_type => "integer", + default_value => 0, + is_foreign_key => 1, + is_nullable => 0, + }, + "branchcode", + { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 }, + "cancellationdate", + { + data_type => "datetime", + datetime_undef_if_invalid => 1, + is_nullable => 1, + }, + "recallnotes", + { data_type => "mediumtext", is_nullable => 1 }, + "priority", + { data_type => "smallint", is_nullable => 1 }, + "status", + { data_type => "varchar", is_nullable => 1, size => 1 }, + "timestamp", + { + data_type => "timestamp", + datetime_undef_if_invalid => 1, + default_value => \"current_timestamp", + is_nullable => 0, + }, + "itemnumber", + { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, + "waitingdate", + { + data_type => "datetime", + datetime_undef_if_invalid => 1, + is_nullable => 1, + }, + "expirationdate", + { + data_type => "datetime", + datetime_undef_if_invalid => 1, + is_nullable => 1, + }, + "old", + { data_type => "tinyint", is_nullable => 1 }, + "item_level_recall", + { data_type => "tinyint", default_value => 0, is_nullable => 0 }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("recall_id"); + +=head1 RELATIONS + +=head2 biblionumber + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "biblionumber", + "Koha::Schema::Result::Biblio", + { biblionumber => "biblionumber" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + +=head2 borrowernumber + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "borrowernumber", + "Koha::Schema::Result::Borrower", + { borrowernumber => "borrowernumber" }, + { 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 => "CASCADE", + on_update => "CASCADE", + }, +); + +=head2 itemnumber + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "itemnumber", + "Koha::Schema::Result::Item", + { itemnumber => "itemnumber" }, + { + is_deferrable => 1, + join_type => "LEFT", + on_delete => "CASCADE", + on_update => "CASCADE", + }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-04-23 17:21:08 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ZFB+Z1KH2f0nLL8TErg32w + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; -- 2.11.0