Bugzilla – Attachment 44793 Details for
Bug 10662
Build OAI-PMH Harvesting Client
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10662 - DBIx::Class ResultSets for Testing
Bug-10662---DBIxClass-ResultSets-for-Testing.patch (text/plain), 8.65 KB, created by
Julian Maurice
on 2015-11-12 09:34:12 UTC
(
hide
)
Description:
Bug 10662 - DBIx::Class ResultSets for Testing
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2015-11-12 09:34:12 UTC
Size:
8.65 KB
patch
obsolete
>From c593d3b2d74611548887ee7e8a5a5bc24c4dc2da Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Tue, 8 Sep 2015 12:54:35 +1000 >Subject: [PATCH] Bug 10662 - DBIx::Class ResultSets for Testing > >This patch adds the DBIx::Class ResultSets for testing. These are >necessary in order for the main OAI-PMH harvester patch to work. >--- > Koha/Schema/Result/OaiHarvest.pm | 180 +++++++++++++++++++++++ > Koha/Schema/Result/OaiHarvestRepository.pm | 223 +++++++++++++++++++++++++++++ > 2 files changed, 403 insertions(+) > create mode 100755 Koha/Schema/Result/OaiHarvest.pm > create mode 100755 Koha/Schema/Result/OaiHarvestRepository.pm > >diff --git a/Koha/Schema/Result/OaiHarvest.pm b/Koha/Schema/Result/OaiHarvest.pm >new file mode 100755 >index 0000000..85b6ede >--- /dev/null >+++ b/Koha/Schema/Result/OaiHarvest.pm >@@ -0,0 +1,180 @@ >+use utf8; >+package Koha::Schema::Result::OaiHarvest; >+ >+# Created by DBIx::Class::Schema::Loader >+# DO NOT MODIFY THE FIRST PART OF THIS FILE >+ >+=head1 NAME >+ >+Koha::Schema::Result::OaiHarvest >+ >+=cut >+ >+use strict; >+use warnings; >+ >+use base 'DBIx::Class::Core'; >+ >+=head1 TABLE: C<oai_harvest> >+ >+=cut >+ >+__PACKAGE__->table("oai_harvest"); >+ >+=head1 ACCESSORS >+ >+=head2 oai_harvest_id >+ >+ data_type: 'integer' >+ is_auto_increment: 1 >+ is_nullable: 0 >+ >+=head2 repository_id >+ >+ data_type: 'integer' >+ is_foreign_key: 1 >+ is_nullable: 0 >+ >+=head2 system_number >+ >+ data_type: 'integer' >+ is_nullable: 1 >+ >+=head2 action >+ >+ data_type: 'varchar' >+ is_nullable: 1 >+ size: 45 >+ >+=head2 timestamp >+ >+ data_type: 'timestamp' >+ datetime_undef_if_invalid: 1 >+ default_value: current_timestamp >+ is_nullable: 0 >+ >+=head2 identifier >+ >+ data_type: 'varchar' >+ is_nullable: 0 >+ size: 255 >+ >+=head2 datestamp >+ >+ data_type: 'varchar' >+ is_nullable: 0 >+ size: 45 >+ >+=head2 metadata_prefix >+ >+ data_type: 'varchar' >+ is_nullable: 0 >+ size: 45 >+ >+=head2 metadata >+ >+ data_type: 'longtext' >+ is_nullable: 1 >+ >+=head2 record_type >+ >+ data_type: 'enum' >+ default_value: 'biblio' >+ extra: {list => ["biblio","auth","holdings"]} >+ is_nullable: 0 >+ >+=head2 original_system_number >+ >+ data_type: 'varchar' >+ is_nullable: 1 >+ size: 45 >+ >+=cut >+ >+__PACKAGE__->add_columns( >+ "oai_harvest_id", >+ { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, >+ "repository_id", >+ { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, >+ "system_number", >+ { data_type => "integer", is_nullable => 1 }, >+ "action", >+ { data_type => "varchar", is_nullable => 1, size => 45 }, >+ "timestamp", >+ { >+ data_type => "timestamp", >+ datetime_undef_if_invalid => 1, >+ default_value => \"current_timestamp", >+ is_nullable => 0, >+ }, >+ "identifier", >+ { data_type => "varchar", is_nullable => 0, size => 255 }, >+ "datestamp", >+ { data_type => "varchar", is_nullable => 0, size => 45 }, >+ "metadata_prefix", >+ { data_type => "varchar", is_nullable => 0, size => 45 }, >+ "metadata", >+ { data_type => "longtext", is_nullable => 1 }, >+ "record_type", >+ { >+ data_type => "enum", >+ default_value => "biblio", >+ extra => { list => ["biblio", "auth", "holdings"] }, >+ is_nullable => 0, >+ }, >+ "original_system_number", >+ { data_type => "varchar", is_nullable => 1, size => 45 }, >+); >+ >+=head1 PRIMARY KEY >+ >+=over 4 >+ >+=item * L</oai_harvest_id> >+ >+=back >+ >+=cut >+ >+__PACKAGE__->set_primary_key("oai_harvest_id"); >+ >+=head1 UNIQUE CONSTRAINTS >+ >+=head2 C<harvest_identifier_datestamp> >+ >+=over 4 >+ >+=item * L</identifier> >+ >+=item * L</datestamp> >+ >+=back >+ >+=cut >+ >+__PACKAGE__->add_unique_constraint("harvest_identifier_datestamp", ["identifier", "datestamp"]); >+ >+=head1 RELATIONS >+ >+=head2 repository >+ >+Type: belongs_to >+ >+Related object: L<Koha::Schema::Result::OaiHarvestRepository> >+ >+=cut >+ >+__PACKAGE__->belongs_to( >+ "repository", >+ "Koha::Schema::Result::OaiHarvestRepository", >+ { repository_id => "repository_id" }, >+ { is_deferrable => 1, on_delete => "RESTRICT", on_update => "NO ACTION" }, >+); >+ >+ >+# Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-08-18 11:54:57 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:MeU+dn+S+ynl/VOAVe0elA >+ >+ >+# You can replace this text with custom code or comments, and it will be preserved on regeneration >+1; >diff --git a/Koha/Schema/Result/OaiHarvestRepository.pm b/Koha/Schema/Result/OaiHarvestRepository.pm >new file mode 100755 >index 0000000..6d7dbec >--- /dev/null >+++ b/Koha/Schema/Result/OaiHarvestRepository.pm >@@ -0,0 +1,223 @@ >+use utf8; >+package Koha::Schema::Result::OaiHarvestRepository; >+ >+# Created by DBIx::Class::Schema::Loader >+# DO NOT MODIFY THE FIRST PART OF THIS FILE >+ >+=head1 NAME >+ >+Koha::Schema::Result::OaiHarvestRepository >+ >+=cut >+ >+use strict; >+use warnings; >+ >+use base 'DBIx::Class::Core'; >+ >+=head1 TABLE: C<oai_harvest_repositories> >+ >+=cut >+ >+__PACKAGE__->table("oai_harvest_repositories"); >+ >+=head1 ACCESSORS >+ >+=head2 repository_id >+ >+ data_type: 'integer' >+ is_auto_increment: 1 >+ is_nullable: 0 >+ >+=head2 base_url >+ >+ data_type: 'text' >+ is_nullable: 0 >+ >+=head2 basic_username >+ >+ data_type: 'text' >+ is_nullable: 1 >+ >+=head2 basic_password >+ >+ data_type: 'text' >+ is_nullable: 1 >+ >+=head2 basic_realm >+ >+ data_type: 'text' >+ is_nullable: 1 >+ >+=head2 datetime_granularity >+ >+ data_type: 'enum' >+ default_value: 'YYYY-MM-DD' >+ extra: {list => ["YYYY-MM-DDThh:mm:ssZ","YYYY-MM-DD"]} >+ is_nullable: 0 >+ >+=head2 opt_from >+ >+ data_type: 'datetime' >+ datetime_undef_if_invalid: 1 >+ is_nullable: 1 >+ >+=head2 opt_until >+ >+ data_type: 'datetime' >+ datetime_undef_if_invalid: 1 >+ is_nullable: 1 >+ >+=head2 opt_set >+ >+ data_type: 'varchar' >+ is_nullable: 1 >+ size: 45 >+ >+=head2 metadata_prefix >+ >+ data_type: 'varchar' >+ is_nullable: 0 >+ size: 45 >+ >+=head2 active >+ >+ data_type: 'integer' >+ default_value: 0 >+ is_nullable: 0 >+ >+=head2 timestamp >+ >+ data_type: 'timestamp' >+ datetime_undef_if_invalid: 1 >+ default_value: current_timestamp >+ is_nullable: 0 >+ >+=head2 xslt_path >+ >+ data_type: 'text' >+ is_nullable: 1 >+ >+=head2 frameworkcode >+ >+ data_type: 'varchar' >+ default_value: (empty string) >+ is_nullable: 0 >+ size: 4 >+ >+=head2 comments >+ >+ data_type: 'text' >+ is_nullable: 1 >+ >+=head2 record_type >+ >+ data_type: 'enum' >+ default_value: 'biblio' >+ extra: {list => ["biblio","auth","holdings"]} >+ is_nullable: 0 >+ >+=head2 original_system_field >+ >+ data_type: 'varchar' >+ is_nullable: 1 >+ size: 45 >+ >+=cut >+ >+__PACKAGE__->add_columns( >+ "repository_id", >+ { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, >+ "base_url", >+ { data_type => "text", is_nullable => 0 }, >+ "basic_username", >+ { data_type => "text", is_nullable => 1 }, >+ "basic_password", >+ { data_type => "text", is_nullable => 1 }, >+ "basic_realm", >+ { data_type => "text", is_nullable => 1 }, >+ "datetime_granularity", >+ { >+ data_type => "enum", >+ default_value => "YYYY-MM-DD", >+ extra => { list => ["YYYY-MM-DDThh:mm:ssZ", "YYYY-MM-DD"] }, >+ is_nullable => 0, >+ }, >+ "opt_from", >+ { >+ data_type => "datetime", >+ datetime_undef_if_invalid => 1, >+ is_nullable => 1, >+ }, >+ "opt_until", >+ { >+ data_type => "datetime", >+ datetime_undef_if_invalid => 1, >+ is_nullable => 1, >+ }, >+ "opt_set", >+ { data_type => "varchar", is_nullable => 1, size => 45 }, >+ "metadata_prefix", >+ { data_type => "varchar", is_nullable => 0, size => 45 }, >+ "active", >+ { data_type => "integer", default_value => 0, is_nullable => 0 }, >+ "timestamp", >+ { >+ data_type => "timestamp", >+ datetime_undef_if_invalid => 1, >+ default_value => \"current_timestamp", >+ is_nullable => 0, >+ }, >+ "xslt_path", >+ { data_type => "text", is_nullable => 1 }, >+ "frameworkcode", >+ { data_type => "varchar", default_value => "", is_nullable => 0, size => 4 }, >+ "comments", >+ { data_type => "text", is_nullable => 1 }, >+ "record_type", >+ { >+ data_type => "enum", >+ default_value => "biblio", >+ extra => { list => ["biblio", "auth", "holdings"] }, >+ is_nullable => 0, >+ }, >+ "original_system_field", >+ { data_type => "varchar", is_nullable => 1, size => 45 }, >+); >+ >+=head1 PRIMARY KEY >+ >+=over 4 >+ >+=item * L</repository_id> >+ >+=back >+ >+=cut >+ >+__PACKAGE__->set_primary_key("repository_id"); >+ >+=head1 RELATIONS >+ >+=head2 oai_harvests >+ >+Type: has_many >+ >+Related object: L<Koha::Schema::Result::OaiHarvest> >+ >+=cut >+ >+__PACKAGE__->has_many( >+ "oai_harvests", >+ "Koha::Schema::Result::OaiHarvest", >+ { "foreign.repository_id" => "self.repository_id" }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ >+ >+# Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-08-18 11:54:57 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:EX+ru6uCSB83y41RHERfhw >+ >+ >+# You can replace this text with custom code or comments, and it will be preserved on regeneration >+1; >-- >1.9.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 10662
:
20757
|
20758
|
21954
|
42446
|
42447
|
42448
|
44792
|
44793
|
47675
|
48096
|
49832
|
50254
|
50980
|
51510
|
51511
|
51512
|
51514
|
51562
|
51563
|
51564
|
51565
|
51705
|
53258
|
53259
|
53260
|
53361
|
53362
|
64444
|
64445
|
64446
|
64479
|
64480
|
64481
|
65016
|
65017
|
65018
|
65019
|
68508
|
71008
|
71009
|
71010
|
71011
|
71012
|
71013
|
71014
|
71015
|
78569
|
78570
|
78571
|
78572
|
78573
|
78574
|
78575
|
78576
|
78577
|
78583
|
78601
|
78617
|
78754
|
78756
|
78758
|
78760
|
78762
|
78764
|
78767
|
78769
|
78771
|
78859
|
78860
|
78914
|
78956
|
79039
|
79045
|
81783
|
81784
|
81786
|
81789
|
81790
|
81855
|
81856
|
81861
|
81862
|
81863
|
81864
|
81902
|
82219
|
84318
|
84319
|
84320
|
84321
|
84322
|
85152
|
85224
|
85225
|
85226
|
85227
|
85228
|
85229
|
99739
|
99740
|
99741
|
99742
|
99743
|
99744
|
99745