From efa021bd7036211cac1e8af62833682b6c1790a9 Mon Sep 17 00:00:00 2001 From: David Cook Date: Thu, 6 Aug 2020 08:22:05 +0000 Subject: [PATCH] Bug 25905: DBIx::Class files --- Koha/Schema/Result/Biblio.pm | 19 +++- Koha/Schema/Result/ImportOaipmhBiblio.pm | 156 +++++++++++++++++++++++++++++++ 2 files changed, 173 insertions(+), 2 deletions(-) create mode 100644 Koha/Schema/Result/ImportOaipmhBiblio.pm diff --git a/Koha/Schema/Result/Biblio.pm b/Koha/Schema/Result/Biblio.pm index 806faf87ad..d3223ca77f 100644 --- a/Koha/Schema/Result/Biblio.pm +++ b/Koha/Schema/Result/Biblio.pm @@ -270,6 +270,21 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 import_oaipmh_biblios + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "import_oaipmh_biblios", + "Koha::Schema::Result::ImportOaipmhBiblio", + { "foreign.biblionumber" => "self.biblionumber" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 items 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-08-06 08:19:43 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:BggBWoQoZp+mFi8TakXiCA __PACKAGE__->has_one( diff --git a/Koha/Schema/Result/ImportOaipmhBiblio.pm b/Koha/Schema/Result/ImportOaipmhBiblio.pm new file mode 100644 index 0000000000..e06b7de3b2 --- /dev/null +++ b/Koha/Schema/Result/ImportOaipmhBiblio.pm @@ -0,0 +1,156 @@ +use utf8; +package Koha::Schema::Result::ImportOaipmhBiblio; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::ImportOaipmhBiblio + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("import_oaipmh_biblios"); + +=head1 ACCESSORS + +=head2 id + + data_type: 'integer' + extra: {unsigned => 1} + is_auto_increment: 1 + is_nullable: 0 + +=head2 repository + + data_type: 'mediumtext' + is_nullable: 0 + +=head2 identifier + + data_type: 'mediumtext' + is_nullable: 0 + +=head2 datestamp + + data_type: 'datetime' + datetime_undef_if_invalid: 1 + is_nullable: 0 + +=head2 deleted + + data_type: 'tinyint' + default_value: 0 + is_nullable: 1 + +=head2 metadata + + data_type: 'longtext' + is_nullable: 0 + +=head2 frameworkcode + + data_type: 'varchar' + is_nullable: 0 + size: 4 + +=head2 biblionumber + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 1 + +=head2 last_modified + + data_type: 'timestamp' + datetime_undef_if_invalid: 1 + default_value: current_timestamp + is_nullable: 0 + +=cut + +__PACKAGE__->add_columns( + "id", + { + data_type => "integer", + extra => { unsigned => 1 }, + is_auto_increment => 1, + is_nullable => 0, + }, + "repository", + { data_type => "mediumtext", is_nullable => 0 }, + "identifier", + { data_type => "mediumtext", is_nullable => 0 }, + "datestamp", + { + data_type => "datetime", + datetime_undef_if_invalid => 1, + is_nullable => 0, + }, + "deleted", + { data_type => "tinyint", default_value => 0, is_nullable => 1 }, + "metadata", + { data_type => "longtext", is_nullable => 0 }, + "frameworkcode", + { data_type => "varchar", is_nullable => 0, size => 4 }, + "biblionumber", + { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, + "last_modified", + { + data_type => "timestamp", + datetime_undef_if_invalid => 1, + default_value => \"current_timestamp", + is_nullable => 0, + }, +); + +=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, + join_type => "LEFT", + on_delete => "CASCADE", + on_update => "NO ACTION", + }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-08-06 08:19:43 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Xlp1qyN+WtHaIoQMlXCvAQ + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; -- 2.11.0