Bugzilla – Attachment 132326 Details for
Bug 30276
Web-based installer failing on db upgrade for 30060
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30276: (bug 30060 follow-up) Fix 21.12.00.016
Bug-30276-bug-30060-follow-up-Fix-211200016.patch (text/plain), 1.75 KB, created by
Jonathan Druart
on 2022-03-28 12:59:09 UTC
(
hide
)
Description:
Bug 30276: (bug 30060 follow-up) Fix 21.12.00.016
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2022-03-28 12:59:09 UTC
Size:
1.75 KB
patch
obsolete
>From bde42a879525fadf912f4b1821e2d6b16ba46627 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 28 Mar 2022 14:01:26 +0200 >Subject: [PATCH] Bug 30276: (bug 30060 follow-up) Fix 21.12.00.016 > >ERROR 1832 (HY000): Cannot change column 'code': used in a foreign key constraint 'user_permissions_ibfk_2' > >Test plan: >Checkout a commit prior to 30060 (c023f63abcce53d71c9492aea4bc7aa30fdc5d73) >reset_all >checkout master+this patch >updatedatabase >--- > installer/data/mysql/db_revs/211200016.pl | 9 +++++++++ > 1 file changed, 9 insertions(+) > >diff --git a/installer/data/mysql/db_revs/211200016.pl b/installer/data/mysql/db_revs/211200016.pl >index bd350b89be4..7f2c173d056 100755 >--- a/installer/data/mysql/db_revs/211200016.pl >+++ b/installer/data/mysql/db_revs/211200016.pl >@@ -21,9 +21,18 @@ return { > $dbh->do(q{ALTER TABLE user_permissions DROP COLUMN temp}); > say $out "Removed any duplicate rows"; > >+ if ( foreign_key_exists('user_permissions', 'user_permissions_ibfk_2') ) { >+ $dbh->do(q{ >+ ALTER TABLE user_permissions DROP FOREIGN KEY user_permissions_ibfk_2 >+ }); >+ } > $dbh->do(q{ > ALTER TABLE user_permissions ADD CONSTRAINT PK_borrowernumber_module_code PRIMARY KEY (borrowernumber,module_bit,code) > }); >+ $dbh->do(q{ >+ ALTER TABLE user_permissions >+ ADD CONSTRAINT `user_permissions_ibfk_2` FOREIGN KEY (`module_bit`, `code`) REFERENCES `permissions` (`module_bit`, `code`) ON DELETE CASCADE ON UPDATE CASCADE; >+ }); > say $out "Added a primary key on user_permissions on borrowernumber, module_bit, code"; > } > }, >-- >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 30276
: 132326