Bugzilla – Attachment 58936 Details for
Bug 17196
Move marcxml out of the biblioitems table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17196: [QA Follow-up] DBIx schema changes
Bug-17196-QA-Follow-up-DBIx-schema-changes.patch (text/plain), 9.75 KB, created by
Marcel de Rooy
on 2017-01-13 09:42:04 UTC
(
hide
)
Description:
Bug 17196: [QA Follow-up] DBIx schema changes
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2017-01-13 09:42:04 UTC
Size:
9.75 KB
patch
obsolete
>From a4ec87114ecba4cb8cc069dac35a8bfeca77dbc1 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 13 Jan 2017 08:37:17 +0100 >Subject: [PATCH] Bug 17196: [QA Follow-up] DBIx schema changes >Content-Type: text/plain; charset=utf-8 > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > 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 9a2f212..f4af407 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<Koha::Schema::Result::BiblioMetadata> >+ >+=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 0000000..0f2ec1d >--- /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<biblio_metadata> >+ >+=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</id> >+ >+=back >+ >+=cut >+ >+__PACKAGE__->set_primary_key("id"); >+ >+=head1 UNIQUE CONSTRAINTS >+ >+=head2 C<biblio_metadata_uniq_key> >+ >+=over 4 >+ >+=item * L</biblionumber> >+ >+=item * L</format> >+ >+=item * L</marcflavour> >+ >+=back >+ >+=cut >+ >+__PACKAGE__->add_unique_constraint( >+ "biblio_metadata_uniq_key", >+ ["biblionumber", "format", "marcflavour"], >+); >+ >+=head1 RELATIONS >+ >+=head2 biblionumber >+ >+Type: belongs_to >+ >+Related object: L<Koha::Schema::Result::Biblio> >+ >+=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 a26314f..fcc9676 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 61adcd1..f3d314a 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<Koha::Schema::Result::DeletedbiblioMetadata> >+ >+=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 0000000..c20f04d >--- /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<deletedbiblio_metadata> >+ >+=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</id> >+ >+=back >+ >+=cut >+ >+__PACKAGE__->set_primary_key("id"); >+ >+=head1 UNIQUE CONSTRAINTS >+ >+=head2 C<deletedbiblio_metadata_uniq_key> >+ >+=over 4 >+ >+=item * L</biblionumber> >+ >+=item * L</format> >+ >+=item * L</marcflavour> >+ >+=back >+ >+=cut >+ >+__PACKAGE__->add_unique_constraint( >+ "deletedbiblio_metadata_uniq_key", >+ ["biblionumber", "format", "marcflavour"], >+); >+ >+=head1 RELATIONS >+ >+=head2 biblionumber >+ >+Type: belongs_to >+ >+Related object: L<Koha::Schema::Result::Deletedbiblio> >+ >+=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 ce588b7..ca5805f 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.1.4
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 17196
:
54910
|
54911
|
54912
|
54913
|
54914
|
54918
|
55856
|
55857
|
55858
|
55859
|
55860
|
55904
|
55905
|
55906
|
55907
|
55908
|
55921
|
55922
|
55950
|
55951
|
56038
|
57835
|
57836
|
57837
|
57838
|
57839
|
57840
|
57841
|
57842
|
58000
|
58007
|
58008
|
58023
|
58024
|
58025
|
58026
|
58027
|
58028
|
58029
|
58030
|
58031
|
58032
|
58037
|
58038
|
58039
|
58040
|
58041
|
58042
|
58043
|
58044
|
58045
|
58046
|
58047
|
58048
|
58504
|
58505
|
58506
|
58507
|
58508
|
58509
|
58510
|
58511
|
58512
|
58513
|
58514
|
58516
|
58517
|
58923
|
58924
|
58925
|
58926
|
58927
|
58928
|
58929
|
58930
|
58931
|
58932
|
58933
|
58934
|
58935
| 58936 |
58937
|
58938
|
58939
|
58943
|
58946
|
58947