From 53e2686f32ada6b40e6082f149baafefa1383f90 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Mon, 21 Jul 2014 11:33:21 -0400 Subject: [PATCH] Bug 9011 [QA Followup 3] - Update database schema files Signed-off-by: Nick Clemens http://bugs.koha-community.org/show_bug.cgi?id=6473 --- C4/Circulation.pm | 3 +-- Koha/Schema/Result/Issue.pm | 20 ++++++++++++++++++++ Koha/Schema/Result/OldIssue.pm | 20 ++++++++++++++++++++ 3 files changed, 41 insertions(+), 2 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index ec66038..1d3bcfe 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -3812,8 +3812,7 @@ sub AnonymizeItemIssueHistory { } if ( $oi && $oi->borrower()->privacy() == 2 ) { - $oi->set_column( 'borrowernumber', $a ); - $oi->update(); + $oi->update( { 'borrowernumber' => $a } ); } } diff --git a/Koha/Schema/Result/Issue.pm b/Koha/Schema/Result/Issue.pm index 4f6dd15..cd42889 100644 --- a/Koha/Schema/Result/Issue.pm +++ b/Koha/Schema/Result/Issue.pm @@ -23,6 +23,12 @@ __PACKAGE__->table("issues"); =head1 ACCESSORS +=head2 issue_id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + =head2 borrowernumber data_type: 'integer' @@ -98,6 +104,8 @@ __PACKAGE__->table("issues"); =cut __PACKAGE__->add_columns( + "issue_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, "borrowernumber", { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, "itemnumber", @@ -145,6 +153,18 @@ __PACKAGE__->add_columns( }, ); +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("issue_id"); + =head1 RELATIONS =head2 borrowernumber diff --git a/Koha/Schema/Result/OldIssue.pm b/Koha/Schema/Result/OldIssue.pm index eca845c..883bf82 100644 --- a/Koha/Schema/Result/OldIssue.pm +++ b/Koha/Schema/Result/OldIssue.pm @@ -23,6 +23,12 @@ __PACKAGE__->table("old_issues"); =head1 ACCESSORS +=head2 issue_id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + =head2 borrowernumber data_type: 'integer' @@ -98,6 +104,8 @@ __PACKAGE__->table("old_issues"); =cut __PACKAGE__->add_columns( + "issue_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, "borrowernumber", { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, "itemnumber", @@ -145,6 +153,18 @@ __PACKAGE__->add_columns( }, ); +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("issue_id"); + =head1 RELATIONS =head2 borrowernumber -- 1.7.2.5