From f518d894bc7c1e37632ff8c94ba3b57586cc5018 Mon Sep 17 00:00:00 2001 From: Matthias Meusburger Date: Thu, 28 Dec 2023 10:36:46 +0000 Subject: [PATCH] DO NOT PUSH: Bug 35659 DBIC Update Signed-off-by: John Doe Signed-off-by: Michal Signed-off-by: John Doe --- Koha/Schema/Result/ImportOaipmhAuthority.pm | 152 ++++++++++++++++++++ Koha/Schema/Result/ImportOaipmhBiblio.pm | 146 +++++++++++++++++++ Koha/Schema/Result/Oaiserver.pm | 136 ++++++++++++++++++ 3 files changed, 434 insertions(+) create mode 100644 Koha/Schema/Result/ImportOaipmhAuthority.pm create mode 100644 Koha/Schema/Result/ImportOaipmhBiblio.pm create mode 100644 Koha/Schema/Result/Oaiserver.pm diff --git a/Koha/Schema/Result/ImportOaipmhAuthority.pm b/Koha/Schema/Result/ImportOaipmhAuthority.pm new file mode 100644 index 0000000000..15e7e5b42a --- /dev/null +++ b/Koha/Schema/Result/ImportOaipmhAuthority.pm @@ -0,0 +1,152 @@ +use utf8; +package Koha::Schema::Result::ImportOaipmhAuthority; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::ImportOaipmhAuthority + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("import_oaipmh_authorities"); + +=head1 ACCESSORS + +=head2 id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + +unique identifier assigned by Koha + +=head2 authid + + data_type: 'bigint' + extra: {unsigned => 1} + is_foreign_key: 1 + is_nullable: 0 + +unique identifier assigned to each koha record + +=head2 identifier + + data_type: 'varchar' + is_nullable: 0 + size: 255 + +OAI record identifier + +=head2 repository + + data_type: 'varchar' + is_nullable: 0 + size: 255 + +OAI repository + +=head2 recordtype + + data_type: 'enum' + default_value: 'biblio' + extra: {list => ["authority","biblio"]} + is_nullable: 0 + +is the record bibliographic or authority + +=head2 datestamp + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +OAI set to harvest + +=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", is_auto_increment => 1, is_nullable => 0 }, + "authid", + { + data_type => "bigint", + extra => { unsigned => 1 }, + is_foreign_key => 1, + is_nullable => 0, + }, + "identifier", + { data_type => "varchar", is_nullable => 0, size => 255 }, + "repository", + { data_type => "varchar", is_nullable => 0, size => 255 }, + "recordtype", + { + data_type => "enum", + default_value => "biblio", + extra => { list => ["authority", "biblio"] }, + is_nullable => 0, + }, + "datestamp", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "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 authid + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "authid", + "Koha::Schema::Result::AuthHeader", + { authid => "authid" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "NO ACTION" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-12-28 09:10:10 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9JtWGrOyu8jBoK1gGIVKFg + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; diff --git a/Koha/Schema/Result/ImportOaipmhBiblio.pm b/Koha/Schema/Result/ImportOaipmhBiblio.pm new file mode 100644 index 0000000000..09c4480be8 --- /dev/null +++ b/Koha/Schema/Result/ImportOaipmhBiblio.pm @@ -0,0 +1,146 @@ +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' + is_auto_increment: 1 + is_nullable: 0 + +unique identifier assigned by Koha + +=head2 biblionumber + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +unique identifier assigned to each koha record + +=head2 identifier + + data_type: 'varchar' + is_nullable: 0 + size: 255 + +OAI record identifier + +=head2 repository + + data_type: 'varchar' + is_nullable: 0 + size: 255 + +OAI repository + +=head2 recordtype + + data_type: 'enum' + default_value: 'biblio' + extra: {list => ["authority","biblio"]} + is_nullable: 0 + +is the record bibliographic or authority + +=head2 datestamp + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +OAI set to harvest + +=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", is_auto_increment => 1, is_nullable => 0 }, + "biblionumber", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "identifier", + { data_type => "varchar", is_nullable => 0, size => 255 }, + "repository", + { data_type => "varchar", is_nullable => 0, size => 255 }, + "recordtype", + { + data_type => "enum", + default_value => "biblio", + extra => { list => ["authority", "biblio"] }, + is_nullable => 0, + }, + "datestamp", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "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, on_delete => "CASCADE", on_update => "NO ACTION" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-12-28 09:10:10 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:SXVQCEuMJAJ1zfKoNEG0jg + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; diff --git a/Koha/Schema/Result/Oaiserver.pm b/Koha/Schema/Result/Oaiserver.pm new file mode 100644 index 0000000000..0a94648b6d --- /dev/null +++ b/Koha/Schema/Result/Oaiserver.pm @@ -0,0 +1,136 @@ +use utf8; +package Koha::Schema::Result::Oaiserver; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::Oaiserver + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("oaiservers"); + +=head1 ACCESSORS + +=head2 id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + +unique identifier assigned by Koha + +=head2 endpoint + + data_type: 'varchar' + is_nullable: 0 + size: 255 + +OAI endpoint (host + port + path) + +=head2 oai_set + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +OAI set to harvest + +=head2 servername + + data_type: 'longtext' + is_nullable: 0 + +name given to the target by the library + +=head2 dataformat + + data_type: 'enum' + default_value: 'oai_dc' + extra: {list => ["oai_dc","marc-xml","marcxml"]} + is_nullable: 0 + +data format + +=head2 recordtype + + data_type: 'enum' + default_value: 'biblio' + extra: {list => ["authority","biblio"]} + is_nullable: 0 + +server contains bibliographic or authority records + +=head2 add_xslt + + data_type: 'longtext' + is_nullable: 1 + +zero or more paths to XSLT files to be processed on the search results + +=cut + +__PACKAGE__->add_columns( + "id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "endpoint", + { data_type => "varchar", is_nullable => 0, size => 255 }, + "oai_set", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "servername", + { data_type => "longtext", is_nullable => 0 }, + "dataformat", + { + data_type => "enum", + default_value => "oai_dc", + extra => { list => ["oai_dc", "marc-xml", "marcxml"] }, + is_nullable => 0, + }, + "recordtype", + { + data_type => "enum", + default_value => "biblio", + extra => { list => ["authority", "biblio"] }, + is_nullable => 0, + }, + "add_xslt", + { data_type => "longtext", is_nullable => 1 }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("id"); + + +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-12-28 09:12:41 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:DaalHke73YH5EXeqzS61bA + +sub koha_object_class { + 'Koha::OaiServer'; +} +sub koha_objects_class { + 'Koha::OaiServers'; +} + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; -- 2.30.2