Bugzilla – Attachment 120659 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.86 KB, created by
Jonathan Druart
on 2021-05-07 07:23:14 UTC
(
hide
)
Description:
Bug 14237: Set course_items.biblionumber in the DBrev
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-05-07 07:23:14 UTC
Size:
1.86 KB
patch
obsolete
>From 2a8f5683991cd4b04502416205f6e9d616d9ef14 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. >--- > ...g_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 185c67a213b..a6e75bfe700 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.20.1
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