Bugzilla – Attachment 154970 Details for
Bug 34276
upgrading 23.05 to 23.05.002
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34276: (bug 21983 follow-up) Fix db rev 23.06.00.002
Bug-34276-bug-21983-follow-up-Fix-db-rev-230600002.patch (text/plain), 2.95 KB, created by
Jonathan Druart
on 2023-08-30 15:02:15 UTC
(
hide
)
Description:
Bug 34276: (bug 21983 follow-up) Fix db rev 23.06.00.002
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2023-08-30 15:02:15 UTC
Size:
2.95 KB
patch
obsolete
>From 908d5d6bf98801576bb116d1025998d38e7034c8 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 30 Aug 2023 16:21:37 +0200 >Subject: [PATCH] Bug 34276: (bug 21983 follow-up) Fix db rev 23.06.00.002 > >--- > installer/data/mysql/db_revs/221200026.pl | 2 +- > installer/data/mysql/db_revs/230600002.pl | 26 +++++++++++++++++++++-- > 2 files changed, 25 insertions(+), 3 deletions(-) > >diff --git a/installer/data/mysql/db_revs/221200026.pl b/installer/data/mysql/db_revs/221200026.pl >index fb8ccc9e6ee..5726f509709 100755 >--- a/installer/data/mysql/db_revs/221200026.pl >+++ b/installer/data/mysql/db_revs/221200026.pl >@@ -31,7 +31,7 @@ return { > $dbh->do(q{ > ALTER TABLE illrequests > ADD KEY `illrequests_bibfk` (`biblio_id`), >- ADD FOREIGN KEY illrequests_bibfk (`biblio_id`) REFERENCES `biblio` (`biblionumber`) ON DELETE SET NULL ON UPDATE CASCADE; >+ ADD CONSTRAINT illrequests_bibfk FOREIGN KEY (`biblio_id`) REFERENCES `biblio` (`biblionumber`) ON DELETE SET NULL ON UPDATE CASCADE; > }); > > say $out "Added foreign key constraint 'illrequests.illrequests_bibfk'"; >diff --git a/installer/data/mysql/db_revs/230600002.pl b/installer/data/mysql/db_revs/230600002.pl >index 2453185c682..21804ee49d8 100755 >--- a/installer/data/mysql/db_revs/230600002.pl >+++ b/installer/data/mysql/db_revs/230600002.pl >@@ -27,11 +27,33 @@ return { > AND illrequests.biblio_id IS NOT NULL > }); > >- unless ( foreign_key_exists( 'illrequests', 'illrequests_bibfk' ) ) { >+ if ( foreign_key_exists( 'illrequests', 'illrequests_ibfk_1' ) ) { >+ $dbh->do(q{ >+ ALTER TABLE illrequests >+ DROP FOREIGN KEY illrequests_ibfk_1 >+ }); >+ } >+ >+ if ( !foreign_key_exists( 'illrequests', 'illrequests_bibfk' ) >+ || !index_exists('illrequests', 'illrequests_bibfk') ) { >+ >+ if ( foreign_key_exists( 'illrequests', 'illrequests_bibfk' ) ) { >+ $dbh->do(q{ >+ ALTER TABLE illrequests >+ DROP FOREIGN KEY illrequests_bibfk >+ }); >+ } >+ if (index_exists('illrequests', 'illrequests_bibfk')) { >+ $dbh->do(q{ >+ ALTER TABLE illrequests >+ DROP INDEX illrequests_bibfk >+ }); >+ } >+ > $dbh->do(q{ > ALTER TABLE illrequests > ADD KEY `illrequests_bibfk` (`biblio_id`), >- ADD FOREIGN KEY illrequests_bibfk (`biblio_id`) REFERENCES `biblio` (`biblionumber`) ON DELETE SET NULL ON UPDATE CASCADE; >+ ADD CONSTRAINT illrequests_bibfk FOREIGN KEY (`biblio_id`) REFERENCES `biblio` (`biblionumber`) ON DELETE SET NULL ON UPDATE CASCADE; > }); > > say $out "Added foreign key constraint 'illrequests.illrequests_bibfk'"; >-- >2.25.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 34276
:
154970
|
155009
|
155053