From 17800939e8a3e6f34549ade0e5e068728e5cb907 Mon Sep 17 00:00:00 2001 From: Henri-Damien LAURENT Date: Wed, 7 Jul 2010 15:58:58 +0200 Subject: [PATCH] Update 3.0 to 3.2 budgets FOREIGN_KEY_CHECKS had to be set to 0 in order to make the upgrade of aqbudgets table work. Signed-off-by: Galen Charlton --- installer/data/mysql/updatedatabase.pl | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 5db690a356..68e7cbcf4f 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -2874,6 +2874,8 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { $DBversion = '3.01.00.077'; if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + + $dbh->do("SET FOREIGN_KEY_CHECKS=0 "); $dbh->do("DROP TABLE IF EXISTS `aqbudgetperiods` "); $dbh->do(qq| CREATE TABLE `aqbudgetperiods` ( @@ -2890,7 +2892,7 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { $dbh->do(< AQBUDGETS IMPORT JUST YET, # BUT A NEW CLEAN AQBUDGETS TABLE CREATE FOR NOW.. @@ -2906,18 +2908,19 @@ ADDPERIODS #$dbh->do("drop table aqbudget;"); - $dbh->do(<selectcol_arrayref(<selectcol_arrayref(<do(<do(<do(<do("DROP TABLE aqbookfund "); - - # $dbh->do("ALTER TABLE aqorders ADD FOREIGN KEY (`budget_id`) REFERENCES `aqbudgets` (`budget_id`) ON UPDATE CASCADE " ); ???? + $dbh->do("SET FOREIGN_KEY_CHECKS=1 "); print "Upgrade to $DBversion done (Adding new aqbudgetperiods, aqbudgets and aqbudget_planning tables )\n"; SetVersion ($DBversion); -- 2.39.5