Bug 14544: [QA Follow-up] DBIx::Class changes
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Fri, 16 Oct 2015 07:09:17 +0000 (09:09 +0200)
committerTomas Cohen Arazi <tomascohen@theke.io>
Thu, 5 Nov 2015 13:00:31 +0000 (10:00 -0300)
One of the follow-ups added a belongs_to from Biblioitem to Item just
as biblioitemnumber was a foreign key to Item. The relation goes the
other way.

As a temporary measure, I added set_primary_key in the local section of
Virtualshelfcontent. Should be moved later with a real db rev.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Koha/Schema/Result/Biblioitem.pm
Koha/Schema/Result/Virtualshelfcontent.pm

index d34b2ef..a9b926a 100644 (file)
@@ -345,6 +345,5 @@ __PACKAGE__->has_many(
 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:A/4lKYlKWWd8TcMVzMRtCg
 
 __PACKAGE__->belongs_to( biblio => "Koha::Schema::Result::Biblio", "biblionumber" );
-__PACKAGE__->belongs_to( items  => "Koha::Schema::Result::Item",   "biblioitemnumber" );
 
 1;
index 906a058..a8ad19d 100644 (file)
@@ -141,6 +141,8 @@ __PACKAGE__->belongs_to(
 # Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-07-11 09:26:55
 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ie3Gx+/HthZQ/4fHjcPF0w
 
+#TODO See BZ 14544: Should be resolved by db revision
+__PACKAGE__->set_primary_key("shelfnumber","biblionumber");
 
 # You can replace this text with custom content, and it will be preserved on regeneration
 1;