Bugzilla – Attachment 171127 Details for
Bug 37820
Upgrade fails at 23.12.00.023 [Bug 36993]
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37820: Upgrade fails at 23.12.00.023 [Bug 36993]
Bug-37820-Upgrade-fails-at-231200023-Bug-36993.patch (text/plain), 2.55 KB, created by
Marcel de Rooy
on 2024-09-06 07:53:21 UTC
(
hide
)
Description:
Bug 37820: Upgrade fails at 23.12.00.023 [Bug 36993]
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2024-09-06 07:53:21 UTC
Size:
2.55 KB
patch
obsolete
>From 033b23b563452fc9465e72bb1358b5bdb76081e4 Mon Sep 17 00:00:00 2001 >From: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> >Date: Wed, 4 Sep 2024 08:47:20 +0300 >Subject: [PATCH] Bug 37820: Upgrade fails at 23.12.00.023 [Bug 36993] >Content-Type: text/plain; charset=utf-8 > >If table aqbudgets is miissing foreign key >'aqbudgetperiods_ibfk_1' database update fails on >"Can't DROP FOREIGN KEY" error. > >To test: >1. Remove changes made in bug 32132, drop foreign key >aqbudgetperiods_ibfk_1 and downgrade your database: >- ALTER TABLE aqbudgets MODIFY COLUMN `budget_period_id` INT(11) NULL; >- UPDATE aqbudgets SET budget_period_id = NULL >WHERE budget_period_id IN(SELECT budget_period_id FROM aqbudgetperiods >WHERE budget_period_description = "Budget for funds without budget"); >- DELETE FROM aqbudgetperiods >WHERE budget_period_description = "Budget for funds without budget"; >- ALTER TABLE aqbudgets DROP FOREIGN KEY aqbudgetperiods_ibfk_1; >- UPDATE systempreferences SET value="23.1200022" WHERE variable = "Version; >2. Upgrade your database (e.g. running installer/data/mysql/updatedatabase.pl) >=> Update fails on error "Can't DROP FOREIGN KEY `aqbudgetperiods_ibfk_1`;...". >4. Apply this patch. >5. Try to update your database again. >=> Database should now be upgraded succesfully. >=> Confirm table aqbudgets now contains 'aqbudgetperiods_ibfk_1'. > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > installer/data/mysql/db_revs/231200023.pl | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > >diff --git a/installer/data/mysql/db_revs/231200023.pl b/installer/data/mysql/db_revs/231200023.pl >index cf413d31cb..2d25669e70 100755 >--- a/installer/data/mysql/db_revs/231200023.pl >+++ b/installer/data/mysql/db_revs/231200023.pl >@@ -30,8 +30,10 @@ return { > "There were $count budget(s) without budget_period_id. They all have been updated to be under budget called 'Budget for funds without budget' (id $aqbp_id)."; > } > >- $dbh->do(q{ALTER TABLE aqbudgets DROP FOREIGN KEY aqbudgetperiods_ibfk_1}); >- say $out "Dropped foreign key aqbudgetperiods_ibfk_1"; >+ if ( foreign_key_exists( 'aqbudgets', 'aqbudgetperiods_ibfk_1' ) ) { >+ $dbh->do(q{ALTER TABLE aqbudgets DROP FOREIGN KEY aqbudgetperiods_ibfk_1}); >+ say $out "Dropped foreign key aqbudgetperiods_ibfk_1"; >+ } > > $dbh->do(q{ALTER TABLE aqbudgets MODIFY COLUMN `budget_period_id` INT(11) NOT NULL}); > say $out "Updated aqbudgets.budget_period_id to NOT accept NULL values"; >-- >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 37820
:
171010
|
171051
| 171127