From 573bbaf254052fafb2e2f12056887ab0023a6234 Mon Sep 17 00:00:00 2001 From: David Cook Date: Fri, 2 Nov 2018 06:56:57 +0000 Subject: [PATCH] Bug 10662: (QA follow-up) provide DBIC schema files DBIC schema files Signed-off-by: Josef Moravec --- Koha/Schema/Result/Biblio.pm | 16 +- Koha/Schema/Result/OaiHarvesterBiblio.pm | 120 +++++++++++++++ Koha/Schema/Result/OaiHarvesterHistory.pm | 163 ++++++++++++++++++++ Koha/Schema/Result/OaiHarvesterImportQueue.pm | 106 +++++++++++++ Koha/Schema/Result/OaiHarvesterRequest.pm | 209 ++++++++++++++++++++++++++ 5 files changed, 613 insertions(+), 1 deletion(-) create mode 100644 Koha/Schema/Result/OaiHarvesterBiblio.pm create mode 100644 Koha/Schema/Result/OaiHarvesterHistory.pm create mode 100644 Koha/Schema/Result/OaiHarvesterImportQueue.pm create mode 100644 Koha/Schema/Result/OaiHarvesterRequest.pm diff --git a/Koha/Schema/Result/Biblio.pm b/Koha/Schema/Result/Biblio.pm index 7c66b1dc03..b0d18c0198 100644 --- a/Koha/Schema/Result/Biblio.pm +++ b/Koha/Schema/Result/Biblio.pm @@ -285,6 +285,21 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 oai_harvester_biblios + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "oai_harvester_biblios", + "Koha::Schema::Result::OaiHarvesterBiblio", + { "foreign.biblionumber" => "self.biblionumber" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 old_reserves Type: has_many @@ -409,7 +424,6 @@ __PACKAGE__->has_many( # Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-10-01 07:08:47 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:otCex8qzJmZyc+JXpKNdpQ - __PACKAGE__->has_one( "metadata", "Koha::Schema::Result::BiblioMetadata", diff --git a/Koha/Schema/Result/OaiHarvesterBiblio.pm b/Koha/Schema/Result/OaiHarvesterBiblio.pm new file mode 100644 index 0000000000..72cf109d06 --- /dev/null +++ b/Koha/Schema/Result/OaiHarvesterBiblio.pm @@ -0,0 +1,120 @@ +use utf8; +package Koha::Schema::Result::OaiHarvesterBiblio; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::OaiHarvesterBiblio + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("oai_harvester_biblios"); + +=head1 ACCESSORS + +=head2 import_oai_biblio_id + + data_type: 'integer' + extra: {unsigned => 1} + is_auto_increment: 1 + is_nullable: 0 + +=head2 oai_repository + + data_type: 'varchar' + is_nullable: 0 + size: 191 + +=head2 oai_identifier + + data_type: 'varchar' + is_nullable: 1 + size: 191 + +=head2 biblionumber + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +=cut + +__PACKAGE__->add_columns( + "import_oai_biblio_id", + { + data_type => "integer", + extra => { unsigned => 1 }, + is_auto_increment => 1, + is_nullable => 0, + }, + "oai_repository", + { data_type => "varchar", is_nullable => 0, size => 191 }, + "oai_identifier", + { data_type => "varchar", is_nullable => 1, size => 191 }, + "biblionumber", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("import_oai_biblio_id"); + +=head1 UNIQUE CONSTRAINTS + +=head2 C + +=over 4 + +=item * L + +=item * L + +=back + +=cut + +__PACKAGE__->add_unique_constraint("oai_record", ["oai_identifier", "oai_repository"]); + +=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 => "NO ACTION" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-11-02 06:45:23 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:bBt9ph/pSfV97DMNrKCkpQ + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; diff --git a/Koha/Schema/Result/OaiHarvesterHistory.pm b/Koha/Schema/Result/OaiHarvesterHistory.pm new file mode 100644 index 0000000000..0fae7518e8 --- /dev/null +++ b/Koha/Schema/Result/OaiHarvesterHistory.pm @@ -0,0 +1,163 @@ +use utf8; +package Koha::Schema::Result::OaiHarvesterHistory; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::OaiHarvesterHistory + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("oai_harvester_history"); + +=head1 ACCESSORS + +=head2 import_oai_id + + data_type: 'integer' + extra: {unsigned => 1} + is_auto_increment: 1 + is_nullable: 0 + +=head2 repository + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +=head2 header_identifier + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +=head2 header_datestamp + + data_type: 'datetime' + datetime_undef_if_invalid: 1 + is_nullable: 0 + +=head2 header_status + + data_type: 'varchar' + is_nullable: 1 + size: 45 + +=head2 record + + data_type: 'longtext' + is_nullable: 0 + +=head2 upload_timestamp + + data_type: 'timestamp' + datetime_undef_if_invalid: 1 + default_value: current_timestamp + is_nullable: 0 + +=head2 status + + data_type: 'varchar' + is_nullable: 0 + size: 45 + +=head2 filter + + data_type: 'text' + is_nullable: 0 + +=head2 framework + + data_type: 'varchar' + is_nullable: 0 + size: 4 + +=head2 record_type + + data_type: 'enum' + extra: {list => ["biblio","auth","holdings"]} + is_nullable: 0 + +=head2 matcher_code + + data_type: 'varchar' + is_nullable: 1 + size: 10 + +=cut + +__PACKAGE__->add_columns( + "import_oai_id", + { + data_type => "integer", + extra => { unsigned => 1 }, + is_auto_increment => 1, + is_nullable => 0, + }, + "repository", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "header_identifier", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "header_datestamp", + { + data_type => "datetime", + datetime_undef_if_invalid => 1, + is_nullable => 0, + }, + "header_status", + { data_type => "varchar", is_nullable => 1, size => 45 }, + "record", + { data_type => "longtext", is_nullable => 0 }, + "upload_timestamp", + { + data_type => "timestamp", + datetime_undef_if_invalid => 1, + default_value => \"current_timestamp", + is_nullable => 0, + }, + "status", + { data_type => "varchar", is_nullable => 0, size => 45 }, + "filter", + { data_type => "text", is_nullable => 0 }, + "framework", + { data_type => "varchar", is_nullable => 0, size => 4 }, + "record_type", + { + data_type => "enum", + extra => { list => ["biblio", "auth", "holdings"] }, + is_nullable => 0, + }, + "matcher_code", + { data_type => "varchar", is_nullable => 1, size => 10 }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("import_oai_id"); + + +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-11-02 06:45:23 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:D948WAzJJ0Nzd974FjQzwQ + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; diff --git a/Koha/Schema/Result/OaiHarvesterImportQueue.pm b/Koha/Schema/Result/OaiHarvesterImportQueue.pm new file mode 100644 index 0000000000..0b75f0c1ac --- /dev/null +++ b/Koha/Schema/Result/OaiHarvesterImportQueue.pm @@ -0,0 +1,106 @@ +use utf8; +package Koha::Schema::Result::OaiHarvesterImportQueue; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::OaiHarvesterImportQueue + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("oai_harvester_import_queue"); + +=head1 ACCESSORS + +=head2 id + + data_type: 'integer' + extra: {unsigned => 1} + is_auto_increment: 1 + is_nullable: 0 + +=head2 uuid + + data_type: 'varchar' + is_nullable: 0 + size: 45 + +=head2 status + + data_type: 'varchar' + default_value: 'new' + is_nullable: 0 + size: 45 + +=head2 result + + data_type: 'text' + is_nullable: 0 + +=head2 result_timestamp + + 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, + }, + "uuid", + { data_type => "varchar", is_nullable => 0, size => 45 }, + "status", + { + data_type => "varchar", + default_value => "new", + is_nullable => 0, + size => 45, + }, + "result", + { data_type => "text", is_nullable => 0 }, + "result_timestamp", + { + 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"); + + +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-11-02 06:45:23 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:mPhK/vLiab1vjl/T/RwoAw + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; diff --git a/Koha/Schema/Result/OaiHarvesterRequest.pm b/Koha/Schema/Result/OaiHarvesterRequest.pm new file mode 100644 index 0000000000..68ce9fa47e --- /dev/null +++ b/Koha/Schema/Result/OaiHarvesterRequest.pm @@ -0,0 +1,209 @@ +use utf8; +package Koha::Schema::Result::OaiHarvesterRequest; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::OaiHarvesterRequest + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("oai_harvester_requests"); + +=head1 ACCESSORS + +=head2 id + + data_type: 'integer' + extra: {unsigned => 1} + is_auto_increment: 1 + is_nullable: 0 + +=head2 uuid + + data_type: 'varchar' + is_nullable: 0 + size: 45 + +=head2 oai_verb + + data_type: 'varchar' + is_nullable: 0 + size: 45 + +=head2 oai_metadataPrefix + + accessor: 'oai_metadata_prefix' + data_type: 'varchar' + is_nullable: 0 + size: 255 + +=head2 oai_identifier + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +=head2 oai_from + + data_type: 'varchar' + is_nullable: 1 + size: 45 + +=head2 oai_until + + data_type: 'varchar' + is_nullable: 1 + size: 45 + +=head2 oai_set + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +=head2 http_url + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +=head2 http_username + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +=head2 http_password + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +=head2 http_realm + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +=head2 import_filter + + data_type: 'varchar' + is_nullable: 0 + size: 255 + +=head2 import_framework_code + + data_type: 'varchar' + is_nullable: 0 + size: 4 + +=head2 import_record_type + + data_type: 'enum' + extra: {list => ["biblio","auth","holdings"]} + is_nullable: 0 + +=head2 import_matcher_code + + data_type: 'varchar' + is_nullable: 1 + size: 10 + +=head2 interval + + data_type: 'integer' + extra: {unsigned => 1} + is_nullable: 0 + +=head2 name + + data_type: 'varchar' + is_nullable: 0 + size: 45 + +=cut + +__PACKAGE__->add_columns( + "id", + { + data_type => "integer", + extra => { unsigned => 1 }, + is_auto_increment => 1, + is_nullable => 0, + }, + "uuid", + { data_type => "varchar", is_nullable => 0, size => 45 }, + "oai_verb", + { data_type => "varchar", is_nullable => 0, size => 45 }, + "oai_metadataPrefix", + { + accessor => "oai_metadata_prefix", + data_type => "varchar", + is_nullable => 0, + size => 255, + }, + "oai_identifier", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "oai_from", + { data_type => "varchar", is_nullable => 1, size => 45 }, + "oai_until", + { data_type => "varchar", is_nullable => 1, size => 45 }, + "oai_set", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "http_url", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "http_username", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "http_password", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "http_realm", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "import_filter", + { data_type => "varchar", is_nullable => 0, size => 255 }, + "import_framework_code", + { data_type => "varchar", is_nullable => 0, size => 4 }, + "import_record_type", + { + data_type => "enum", + extra => { list => ["biblio", "auth", "holdings"] }, + is_nullable => 0, + }, + "import_matcher_code", + { data_type => "varchar", is_nullable => 1, size => 10 }, + "interval", + { data_type => "integer", extra => { unsigned => 1 }, is_nullable => 0 }, + "name", + { data_type => "varchar", is_nullable => 0, size => 45 }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("id"); + + +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-11-02 06:45:23 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:c8IcaxEQMjEZvM4LPzOTKg + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; -- 2.11.0