From 6c3f6d9e474777382c22cc2196b165f63c1fb9ab Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 13 Jan 2017 08:37:17 +0100 Subject: [PATCH] Bug 17196: [QA Follow-up] DBIx schema changes Signed-off-by: Marcel de Rooy Signed-off-by: Kyle M Hall --- Koha/Schema/Result/Biblio.pm | 19 ++- Koha/Schema/Result/BiblioMetadata.pm | 126 ++++++++++++++++++++ Koha/Schema/Result/Biblioitem.pm | 11 +- Koha/Schema/Result/Deletedbiblio.pm | 21 +++- Koha/Schema/Result/DeletedbiblioMetadata.pm | 126 ++++++++++++++++++++ Koha/Schema/Result/Deletedbiblioitem.pm | 11 +- 6 files changed, 292 insertions(+), 22 deletions(-) create mode 100644 Koha/Schema/Result/BiblioMetadata.pm create mode 100644 Koha/Schema/Result/DeletedbiblioMetadata.pm diff --git a/Koha/Schema/Result/Biblio.pm b/Koha/Schema/Result/Biblio.pm index 9a2f212681..f4af407f74 100644 --- a/Koha/Schema/Result/Biblio.pm +++ b/Koha/Schema/Result/Biblio.pm @@ -167,6 +167,21 @@ __PACKAGE__->has_many( { cascade_copy => 0, cascade_delete => 0 }, ); +=head2 biblio_metadatas + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "biblio_metadatas", + "Koha::Schema::Result::BiblioMetadata", + { "foreign.biblionumber" => "self.biblionumber" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 biblioimages Type: has_many @@ -333,7 +348,7 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-10-24 13:56:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:IC5u5De1u1DS26kQQ7xmUQ +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-01-13 08:36:25 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jis7Sm5+9lVKav+o18JLtA 1; diff --git a/Koha/Schema/Result/BiblioMetadata.pm b/Koha/Schema/Result/BiblioMetadata.pm new file mode 100644 index 0000000000..0f2ec1d5d7 --- /dev/null +++ b/Koha/Schema/Result/BiblioMetadata.pm @@ -0,0 +1,126 @@ +use utf8; +package Koha::Schema::Result::BiblioMetadata; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::BiblioMetadata + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("biblio_metadata"); + +=head1 ACCESSORS + +=head2 id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + +=head2 biblionumber + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +=head2 format + + data_type: 'varchar' + is_nullable: 0 + size: 16 + +=head2 marcflavour + + data_type: 'varchar' + is_nullable: 0 + size: 16 + +=head2 metadata + + data_type: 'longtext' + 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 }, + "format", + { data_type => "varchar", is_nullable => 0, size => 16 }, + "marcflavour", + { data_type => "varchar", is_nullable => 0, size => 16 }, + "metadata", + { data_type => "longtext", is_nullable => 0 }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("id"); + +=head1 UNIQUE CONSTRAINTS + +=head2 C + +=over 4 + +=item * L + +=item * L + +=item * L + +=back + +=cut + +__PACKAGE__->add_unique_constraint( + "biblio_metadata_uniq_key", + ["biblionumber", "format", "marcflavour"], +); + +=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" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-01-13 08:36:25 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:LoYje8i9pvKcBn8DQwH/Sg + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; diff --git a/Koha/Schema/Result/Biblioitem.pm b/Koha/Schema/Result/Biblioitem.pm index a26314f6a1..fcc9676b13 100644 --- a/Koha/Schema/Result/Biblioitem.pm +++ b/Koha/Schema/Result/Biblioitem.pm @@ -203,11 +203,6 @@ __PACKAGE__->table("biblioitems"); data_type: 'integer' is_nullable: 1 -=head2 marcxml - - data_type: 'longtext' - is_nullable: 1 - =cut __PACKAGE__->add_columns( @@ -285,8 +280,6 @@ __PACKAGE__->add_columns( { data_type => "varchar", is_nullable => 1, size => 255 }, "totalissues", { data_type => "integer", is_nullable => 1 }, - "marcxml", - { data_type => "longtext", is_nullable => 1 }, ); =head1 PRIMARY KEY @@ -334,8 +327,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-10-21 14:37:19 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:sIIeEpbe61VNkEYpUXNDkw +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-01-13 08:36:25 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:cAlg2aIZ7hxeq+Hgl1AJcA __PACKAGE__->belongs_to( biblio => "Koha::Schema::Result::Biblio", "biblionumber" ); diff --git a/Koha/Schema/Result/Deletedbiblio.pm b/Koha/Schema/Result/Deletedbiblio.pm index 61adcd1dd2..f3d314a108 100644 --- a/Koha/Schema/Result/Deletedbiblio.pm +++ b/Koha/Schema/Result/Deletedbiblio.pm @@ -135,9 +135,26 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("biblionumber"); +=head1 RELATIONS -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:T381rHb43DPfZ7+d/WuSxQ +=head2 deletedbiblio_metadatas + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "deletedbiblio_metadatas", + "Koha::Schema::Result::DeletedbiblioMetadata", + { "foreign.biblionumber" => "self.biblionumber" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-01-13 08:36:25 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:HBjJjCdFsEUOPmxexvK27g # You can replace this text with custom content, and it will be preserved on regeneration diff --git a/Koha/Schema/Result/DeletedbiblioMetadata.pm b/Koha/Schema/Result/DeletedbiblioMetadata.pm new file mode 100644 index 0000000000..c20f04da33 --- /dev/null +++ b/Koha/Schema/Result/DeletedbiblioMetadata.pm @@ -0,0 +1,126 @@ +use utf8; +package Koha::Schema::Result::DeletedbiblioMetadata; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::DeletedbiblioMetadata + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("deletedbiblio_metadata"); + +=head1 ACCESSORS + +=head2 id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + +=head2 biblionumber + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +=head2 format + + data_type: 'varchar' + is_nullable: 0 + size: 16 + +=head2 marcflavour + + data_type: 'varchar' + is_nullable: 0 + size: 16 + +=head2 metadata + + data_type: 'longtext' + 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 }, + "format", + { data_type => "varchar", is_nullable => 0, size => 16 }, + "marcflavour", + { data_type => "varchar", is_nullable => 0, size => 16 }, + "metadata", + { data_type => "longtext", is_nullable => 0 }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("id"); + +=head1 UNIQUE CONSTRAINTS + +=head2 C + +=over 4 + +=item * L + +=item * L + +=item * L + +=back + +=cut + +__PACKAGE__->add_unique_constraint( + "deletedbiblio_metadata_uniq_key", + ["biblionumber", "format", "marcflavour"], +); + +=head1 RELATIONS + +=head2 biblionumber + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "biblionumber", + "Koha::Schema::Result::Deletedbiblio", + { biblionumber => "biblionumber" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-01-13 08:36:25 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:hKgy8bBepvfP/ZYPApJnwQ + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; diff --git a/Koha/Schema/Result/Deletedbiblioitem.pm b/Koha/Schema/Result/Deletedbiblioitem.pm index ce588b73c1..ca5805fb3c 100644 --- a/Koha/Schema/Result/Deletedbiblioitem.pm +++ b/Koha/Schema/Result/Deletedbiblioitem.pm @@ -202,11 +202,6 @@ __PACKAGE__->table("deletedbiblioitems"); data_type: 'integer' is_nullable: 1 -=head2 marcxml - - data_type: 'longtext' - is_nullable: 1 - =cut __PACKAGE__->add_columns( @@ -279,8 +274,6 @@ __PACKAGE__->add_columns( { data_type => "varchar", is_nullable => 1, size => 255 }, "totalissues", { data_type => "integer", is_nullable => 1 }, - "marcxml", - { data_type => "longtext", is_nullable => 1 }, ); =head1 PRIMARY KEY @@ -296,8 +289,8 @@ __PACKAGE__->add_columns( __PACKAGE__->set_primary_key("biblioitemnumber"); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-10-21 14:37:19 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Rijc/QK/Kdh3bMcbOTF8Tg +# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-01-13 08:36:25 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ZFXb+BlsrsArv8qE2DrkkA # You can replace this text with custom content, and it will be preserved on regeneration -- 2.39.5