Bugzilla – Attachment 121880 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: Set course_items.biblionumber in the DBrev
Bug-14237-Set-courseitemsbiblionumber-in-the-DBrev.patch (text/plain), 1.92 KB, created by
Nick Clemens (kidclamp)
on 2021-06-11 19:21:44 UTC
(
hide
)
Description:
Bug 14237: Set course_items.biblionumber in the DBrev
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2021-06-11 19:21:44 UTC
Size:
1.92 KB
patch
obsolete
>From ef1203021dc3e95ba7ba3e15e6d84edf23c4f674 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 7 May 2021 09:22:50 +0200 >Subject: [PATCH] Bug 14237: Set course_items.biblionumber in the DBrev > >We need to create the new column without the NOT NULL clause, set the >correct values, then add the NOT NULL clause. > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > .../bug_14237-add_course_items.biblionumber_column.perl | 12 +++++++++++- > 1 file changed, 11 insertions(+), 1 deletion(-) > >diff --git a/installer/data/mysql/atomicupdate/bug_14237-add_course_items.biblionumber_column.perl b/installer/data/mysql/atomicupdate/bug_14237-add_course_items.biblionumber_column.perl >index 185c67a213..a6e75bfe70 100644 >--- a/installer/data/mysql/atomicupdate/bug_14237-add_course_items.biblionumber_column.perl >+++ b/installer/data/mysql/atomicupdate/bug_14237-add_course_items.biblionumber_column.perl >@@ -1,7 +1,17 @@ > $DBversion = 'XXX'; > if( CheckVersion( $DBversion ) ){ > unless( column_exists( 'course_items', 'biblionumber') ) { >- $dbh->do(q{ ALTER TABLE course_items ADD `biblionumber` int(11) NOT NULL AFTER `itemnumber` }); >+ $dbh->do(q{ ALTER TABLE course_items ADD `biblionumber` int(11) AFTER `itemnumber` }); >+ >+ $dbh->do(q{ >+ UPDATE course_items >+ LEFT JOIN items ON items.itemnumber=course_items.itemnumber >+ SET course_items.biblionumber=items.biblionumber >+ WHERE items.itemnumber IS NOT NULL >+ }); >+ >+ $dbh->do(q{ ALTER TABLE course_items MODIFY COLUMN `biblionumber` INT(11) NOT NULL }); >+ > $dbh->do(q{ ALTER TABLE course_items ADD CONSTRAINT `fk_course_items_biblionumber` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE }); > $dbh->do(q{ ALTER TABLE course_items CHANGE `itemnumber` `itemnumber` int(11) DEFAULT NULL }); > } >-- >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