From 2a7ef42792527a4eb43d427778981eb6ab15971d Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 30 Oct 2015 11:59:30 -0400 Subject: [PATCH] Bug 14610 - Update Schema files --- Koha/Schema/Result/ArticleRequest.pm | 258 +++++++++++++++++++++++++++++++++++ Koha/Schema/Result/Biblio.pm | 19 ++- Koha/Schema/Result/Borrower.pm | 20 ++- Koha/Schema/Result/Branch.pm | 19 ++- Koha/Schema/Result/Issuingrule.pm | 20 ++- Koha/Schema/Result/Item.pm | 20 ++- 6 files changed, 345 insertions(+), 11 deletions(-) create mode 100644 Koha/Schema/Result/ArticleRequest.pm diff --git a/Koha/Schema/Result/ArticleRequest.pm b/Koha/Schema/Result/ArticleRequest.pm new file mode 100644 index 0000000..da6ec6d --- /dev/null +++ b/Koha/Schema/Result/ArticleRequest.pm @@ -0,0 +1,258 @@ +use utf8; +package Koha::Schema::Result::ArticleRequest; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::ArticleRequest + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("article_requests"); + +=head1 ACCESSORS + +=head2 id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + +=head2 borrowernumber + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +=head2 biblionumber + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +=head2 itemnumber + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 1 + +=head2 branchcode + + data_type: 'varchar' + is_foreign_key: 1 + is_nullable: 1 + size: 10 + +=head2 title + + data_type: 'text' + is_nullable: 1 + +=head2 author + + data_type: 'text' + is_nullable: 1 + +=head2 volume + + data_type: 'text' + is_nullable: 1 + +=head2 issue + + data_type: 'text' + is_nullable: 1 + +=head2 date + + data_type: 'text' + is_nullable: 1 + +=head2 pages + + data_type: 'text' + is_nullable: 1 + +=head2 chapters + + data_type: 'text' + is_nullable: 1 + +=head2 status + + data_type: 'enum' + default_value: 'PENDING' + extra: {list => ["PENDING","PROCESSING","COMPLETED","CANCELED"]} + is_nullable: 0 + +=head2 notes + + data_type: 'text' + is_nullable: 1 + +=head2 created_on + + data_type: 'timestamp' + datetime_undef_if_invalid: 1 + default_value: current_timestamp + is_nullable: 0 + +=head2 updated_on + + data_type: 'timestamp' + datetime_undef_if_invalid: 1 + is_nullable: 1 + +=cut + +__PACKAGE__->add_columns( + "id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "borrowernumber", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "biblionumber", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "itemnumber", + { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, + "branchcode", + { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 }, + "title", + { data_type => "text", is_nullable => 1 }, + "author", + { data_type => "text", is_nullable => 1 }, + "volume", + { data_type => "text", is_nullable => 1 }, + "issue", + { data_type => "text", is_nullable => 1 }, + "date", + { data_type => "text", is_nullable => 1 }, + "pages", + { data_type => "text", is_nullable => 1 }, + "chapters", + { data_type => "text", is_nullable => 1 }, + "status", + { + data_type => "enum", + default_value => "PENDING", + extra => { list => ["PENDING", "PROCESSING", "COMPLETED", "CANCELED"] }, + is_nullable => 0, + }, + "notes", + { data_type => "text", is_nullable => 1 }, + "created_on", + { + data_type => "timestamp", + datetime_undef_if_invalid => 1, + default_value => \"current_timestamp", + is_nullable => 0, + }, + "updated_on", + { + data_type => "timestamp", + datetime_undef_if_invalid => 1, + is_nullable => 1, + }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("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 => "SET NULL", + 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 => "SET NULL", + on_update => "CASCADE", + }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-01-12 11:47:10 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:N8Ziim4bGMg5jUDmN8HpxQ + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; diff --git a/Koha/Schema/Result/Biblio.pm b/Koha/Schema/Result/Biblio.pm index 54f6727..85126fd 100644 --- a/Koha/Schema/Result/Biblio.pm +++ b/Koha/Schema/Result/Biblio.pm @@ -152,6 +152,21 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 article_requests + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "article_requests", + "Koha::Schema::Result::ArticleRequest", + { "foreign.biblionumber" => "self.biblionumber" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 biblioimages Type: has_many @@ -303,7 +318,7 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07039 @ 2015-07-08 15:06:22 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:vh7DAGajJCEzHE7YmAG3jg +# Created by DBIx::Class::Schema::Loader v0.07040 @ 2015-10-30 11:59:21 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:yb9wtH9ZqZaESbYl912XWA 1; diff --git a/Koha/Schema/Result/Borrower.pm b/Koha/Schema/Result/Borrower.pm index 97f65d0..9edd867 100644 --- a/Koha/Schema/Result/Borrower.pm +++ b/Koha/Schema/Result/Borrower.pm @@ -685,6 +685,21 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 article_requests + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "article_requests", + "Koha::Schema::Result::ArticleRequest", + { "foreign.borrowernumber" => "self.borrowernumber" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 borrower_attributes Type: has_many @@ -1176,8 +1191,8 @@ Composing rels: L -> ordernumber __PACKAGE__->many_to_many("ordernumbers", "aqorder_users", "ordernumber"); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-01-06 11:59:52 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:0nIBbkzhb+Yfp6qpSLo51A +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-01-12 11:41:30 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:WV/JDE1g8S+eT0rlpdrTvw __PACKAGE__->belongs_to( "guarantor", @@ -1185,4 +1200,5 @@ __PACKAGE__->belongs_to( { borrowernumber => "guarantorid" }, ); +# You can replace this text with custom code or comments, and it will be preserved on regeneration 1; diff --git a/Koha/Schema/Result/Branch.pm b/Koha/Schema/Result/Branch.pm index 106123a..80858f3 100644 --- a/Koha/Schema/Result/Branch.pm +++ b/Koha/Schema/Result/Branch.pm @@ -202,6 +202,21 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 article_requests + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "article_requests", + "Koha::Schema::Result::ArticleRequest", + { "foreign.branchcode" => "self.branchcode" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 authorised_values_branches Type: has_many @@ -513,8 +528,8 @@ Composing rels: L -> categorycode __PACKAGE__->many_to_many("categorycodes", "branchrelations", "categorycode"); -# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-11-06 15:26:36 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:CGNPB/MkGLOihDThj43/4A +# Created by DBIx::Class::Schema::Loader v0.07040 @ 2015-10-30 11:59:21 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9OMvSwvGBfGPIljnStd/IA # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/Issuingrule.pm b/Koha/Schema/Result/Issuingrule.pm index f782456..89b6c8d 100644 --- a/Koha/Schema/Result/Issuingrule.pm +++ b/Koha/Schema/Result/Issuingrule.pm @@ -191,6 +191,13 @@ __PACKAGE__->table("issuingrules"); is_nullable: 0 size: 1 +=head2 article_requests + + data_type: 'enum' + default_value: 'no' + extra: {list => ["no","yes","bib_only","item_only"]} + is_nullable: 0 + =cut __PACKAGE__->add_columns( @@ -257,6 +264,13 @@ __PACKAGE__->add_columns( { data_type => "tinyint", default_value => 0, is_nullable => 0 }, "opacitemholds", { data_type => "char", default_value => "N", is_nullable => 0, size => 1 }, + "article_requests", + { + data_type => "enum", + default_value => "no", + extra => { list => ["no", "yes", "bib_only", "item_only"] }, + is_nullable => 0, + }, ); =head1 PRIMARY KEY @@ -276,9 +290,9 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("branchcode", "categorycode", "itemtype"); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-12-31 15:26:16 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:K/8SKpDjba5CM4+WPZtWPw +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-01-12 11:42:27 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:VYqAUkhiWek+5K4PW9xk5g -# You can replace this text with custom content, and it will be preserved on regeneration +# You can replace this text with custom code or comments, and it will be preserved on regeneration 1; diff --git a/Koha/Schema/Result/Item.pm b/Koha/Schema/Result/Item.pm index c370d86..3183132 100644 --- a/Koha/Schema/Result/Item.pm +++ b/Koha/Schema/Result/Item.pm @@ -425,6 +425,21 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 article_requests + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "article_requests", + "Koha::Schema::Result::ArticleRequest", + { "foreign.itemnumber" => "self.itemnumber" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 biblioitemnumber Type: belongs_to @@ -631,8 +646,8 @@ __PACKAGE__->might_have( ); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-01-06 12:00:28 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:3M6BvB4ATsBXgQCkFKuI3A +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-01-12 11:43:12 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:S0bRZ6WQHKohQc1Ze7Euww __PACKAGE__->belongs_to( biblioitem => "Koha::Schema::Result::Biblioitem", "biblioitemnumber" ); @@ -656,4 +671,5 @@ sub effective_itemtype { } } +# You can replace this text with custom code or comments, and it will be preserved on regeneration 1; -- 2.1.4