Bugzilla – Attachment 43827 Details for
Bug 10363
Move authorised value related code into its own package
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10363: Fix Updatedb entry on MariaDB
Bug-10363-Fix-Updatedb-entry-on-MariaDB.patch (text/plain), 1.75 KB, created by
Jonathan Druart
on 2015-10-23 13:21:38 UTC
(
hide
)
Description:
Bug 10363: Fix Updatedb entry on MariaDB
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-10-23 13:21:38 UTC
Size:
1.75 KB
patch
obsolete
>From ec37898312831d435cbbcdbc5c0dff5837e966c8 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 23 Oct 2015 14:20:17 +0100 >Subject: [PATCH] Bug 10363: Fix Updatedb entry on MariaDB > >With MariaDB, I get the following error: > >ERROR 1832 (HY000): Cannot change column 'av_id': used in a foreign key >constraint 'authorised_values_branches_ibfk_1' > >The solution would be to remove the constraints, modify the columns and >finally reintroduce the foreign keys. >--- > installer/data/mysql/updatedatabase.pl | 13 ++++++++++--- > 1 file changed, 10 insertions(+), 3 deletions(-) > >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 3360de6..6e9c1ae 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -11098,9 +11098,16 @@ if ( CheckVersion($DBversion) ) { > $DBversion = "3.21.00.036"; > if ( CheckVersion($DBversion) ) { > $dbh->do(q{ >- ALTER TABLE authorised_values_branches >- CHANGE av_id av_id INT( 11 ) NOT NULL, >- CHANGE branchcode branchcode VARCHAR( 10 ) NOT NULL >+ ALTER TABLE authorised_values_branches >+ DROP FOREIGN KEY authorised_values_branches_ibfk_1, >+ DROP FOREIGN KEY authorised_values_branches_ibfk_2 >+ }); >+ $dbh->do(q{ >+ ALTER TABLE authorised_values_branches >+ MODIFY av_id INT( 11 ) NOT NULL, >+ MODIFY branchcode VARCHAR( 10 ) NOT NULL, >+ ADD FOREIGN KEY (`av_id`) REFERENCES `authorised_values` (`id`) ON DELETE CASCADE, >+ ADD FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE > }); > print "Upgrade to $DBversion done (Bug 10363: There is no package for authorised values)\n"; > SetVersion($DBversion); >-- >2.1.0
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 10363
:
18430
|
18431
|
18432
|
18751
|
18752
|
18753
|
20729
|
21833
|
21834
|
21835
|
21836
|
25284
|
25285
|
25286
|
25287
|
30583
|
30584
|
30585
|
30710
|
30711
|
30712
|
31565
|
32632
|
32633
|
32634
|
33416
|
33417
|
33422
|
33423
|
33860
|
33861
|
33862
|
33889
|
33949
|
35838
|
35839
|
35840
|
35841
|
41290
|
41291
|
41292
|
41293
|
41294
|
41302
|
41343
|
41344
|
41345
|
43112
|
43113
|
43114
|
43550
|
43551
|
43552
|
43553
|
43554
|
43555
|
43556
|
43557
|
43558
|
43559
|
43696
| 43827