Bugzilla – Attachment 114237 Details for
Bug 24658
Deleting items with fines does not update itemnumber in accountlines to NULL causing ISE
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24658: (bug 22008 follow-up) Correct update DB entry 18.12.00.031
Bug-24658-bug-22008-follow-up-Correct-update-DB-en.patch (text/plain), 1.74 KB, created by
Martin Renvoize (ashimema)
on 2020-12-07 16:52:49 UTC
(
hide
)
Description:
Bug 24658: (bug 22008 follow-up) Correct update DB entry 18.12.00.031
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-12-07 16:52:49 UTC
Size:
1.74 KB
patch
obsolete
>From ff1cc15518f2d9d4760ad58015e74f6d7e30f41a Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 17 Nov 2020 15:15:02 +0100 >Subject: [PATCH] Bug 24658: (bug 22008 follow-up) Correct update DB entry > 18.12.00.031 > >If the original constraint does not exist, the second one is not added. > >Test plan: >1. checkout dbrev 18.12.00.030 >2. Remove the constraint: ALTER TABLE accountlines DROP FOREIGN KEY accountlines_ibfk_2 >3. checkout master >4. >% updatedatabase >=> The constraint accountlines_ibfk_items is not added >5. Repeat 1 to 4 >=> The constraint is added correctly > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > installer/data/mysql/updatedatabase.pl | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 6d96ca6cb7..8db165a434 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -17809,8 +17809,10 @@ if( CheckVersion( $DBversion ) ) { > } > > # Rename accountlines_ibfk_2 to accountlines_ibfk_items >- if ( foreign_key_exists( 'accountlines', 'accountlines_ibfk_2' ) && !foreign_key_exists( 'accountlines', 'accountlines_ibfk_items' ) ) { >+ if ( foreign_key_exists( 'accountlines', 'accountlines_ibfk_2' ) ) { > $dbh->do("ALTER TABLE accountlines DROP FOREIGN KEY accountlines_ibfk_2"); >+ } >+ unless ( foreign_key_exists( 'accountlines', 'accountlines_ibfk_items' ) ) { > $dbh->do("ALTER TABLE accountlines ADD CONSTRAINT `accountlines_ibfk_items` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE SET NULL ON UPDATE CASCADE"); > } > >-- >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 24658
:
113735
|
114139
| 114237