Bugzilla – Attachment 155009 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), 3.01 KB, created by
Pedro Amorim
on 2023-08-31 14:02:11 UTC
(
hide
)
Description:
Bug 34276: (bug 21983 follow-up) Fix db rev 23.06.00.002
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2023-08-31 14:02:11 UTC
Size:
3.01 KB
patch
obsolete
>From e16e702c0763b7323ff5e6090620a7d32ef385eb 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 > >Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> >--- > 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 fb8ccc9e6e..5726f50970 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 2453185c68..21804ee49d 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.30.2
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