Bugzilla – Attachment 120652 Details for
Bug 14237
Allow bibs to be added to course without items
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14237: (follow-up) Set course_items.biblionumber for existing rows
Bug-14237-follow-up-Set-courseitemsbiblionumber-fo.patch (text/plain), 1.67 KB, created by
Aleisha Amohia
on 2021-05-07 02:09:28 UTC
(
hide
)
Description:
Bug 14237: (follow-up) Set course_items.biblionumber for existing rows
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2021-05-07 02:09:28 UTC
Size:
1.67 KB
patch
obsolete
>From 13c27fe9318ac0885b424ec8388cb1ee96fdc976 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Fri, 7 May 2021 14:07:43 +1200 >Subject: [PATCH] Bug 14237: (follow-up) Set course_items.biblionumber for > existing rows > >This atomic update will run after the first atomic update which adds the >biblionumber column to course_items. >--- > ...d_course_items.biblionumber_column_update_existing.perl | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > create mode 100644 installer/data/mysql/atomicupdate/bug_14237-add_course_items.biblionumber_column_update_existing.perl > >diff --git a/installer/data/mysql/atomicupdate/bug_14237-add_course_items.biblionumber_column_update_existing.perl b/installer/data/mysql/atomicupdate/bug_14237-add_course_items.biblionumber_column_update_existing.perl >new file mode 100644 >index 0000000000..177994d44f >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_14237-add_course_items.biblionumber_column_update_existing.perl >@@ -0,0 +1,14 @@ >+$DBversion = 'XXX'; >+if ( CheckVersion( $DBversion ) ) { >+ my $itemnumbers = $dbh->selectall_arrayref("SELECT DISTINCT(itemnumber) FROM course_items", { Slice => {} }); >+ my $query = "UPDATE course_items SET biblionumber = ? WHERE itemnumber = ?"; >+ foreach my $row ( @$itemnumbers ) { >+ my @biblionumber = $dbh->selectrow_array("SELECT biblionumber FROM items WHERE itemnumber = $row->{itemnumber}"); >+ if ( $biblionumber[0] ) { >+ my @bind_values = ( $biblionumber[0], $row->{itemnumber} ); >+ $dbh->do($query, undef, @bind_values); >+ } >+ } >+ >+ NewVersion( $DBversion, 14237, "Update biblionumber for existing course_items" ); >+} >-- >2.11.0
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 14237
:
116236
|
116237
|
116238
|
116239
|
116240
|
116535
|
116619
|
116638
|
116652
|
116653
|
116654
|
118220
|
118221
|
118222
|
118223
|
120128
|
120129
|
120130
|
120131
|
120132
|
120652
|
120659
|
121876
|
121877
|
121878
|
121879
|
121880
|
121881