From 0a7156272cc32a4a0609c7d8fc17471997ae845f Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 11 Nov 2022 13:52:01 +0100 Subject: [PATCH] diff to run updatedatabase from v3.0.6 https://bugs.koha-community.org/show_bug.cgi?id=30951 --- Koha/Database.pm | 3 ++- installer/data/mysql/updatedatabase.pl | 10 ---------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/Koha/Database.pm b/Koha/Database.pm index 376f910c988..d22ae730997 100644 --- a/Koha/Database.pm +++ b/Koha/Database.pm @@ -70,7 +70,7 @@ sub dbh { ); my $attr = { - RaiseError => 1, + RaiseError => 0, PrintError => 1, }; @@ -134,6 +134,7 @@ sub _new_schema { dbh_maker => \&Koha::Database::dbh, quote_names => 1, auto_savepoint => 1, + unsafe => 1, }); my $dbh = $schema->storage->dbh; diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index c95fdf3e3cc..32e48bf4d13 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -83,7 +83,6 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { $dbh->do("ALTER TABLE `virtualshelfcontents` ADD `biblionumber` INT( 11 ) NOT NULL default '0' AFTER shelfnumber"); $dbh->do("UPDATE `virtualshelfcontents` SET biblionumber=(SELECT biblionumber FROM items WHERE items.itemnumber=virtualshelfcontents.itemnumber)"); # drop all foreign keys : otherwise, we can't drop itemnumber field. - DropAllForeignKeys('virtualshelfcontents'); $dbh->do("ALTER TABLE `virtualshelfcontents` ADD KEY biblionumber (biblionumber)"); # create the new foreign keys (on biblionumber) $dbh->do("ALTER TABLE `virtualshelfcontents` ADD CONSTRAINT `virtualshelfcontents_ibfk_1` FOREIGN KEY (`shelfnumber`) REFERENCES `virtualshelves` (`shelfnumber`) ON DELETE CASCADE ON UPDATE CASCADE"); @@ -2941,7 +2940,6 @@ ADDPERIODS # `budgetamount` decimal(13,2) default NULL, # `aqbudgetid` tinyint(4) NOT NULL auto_increment, # `branchcode` varchar(10) default NULL, - DropAllForeignKeys('aqbudget'); #$dbh->do("drop table aqbudget;"); @@ -9758,14 +9756,6 @@ if ( CheckVersion($DBversion) ) { ) |, { Slice => {} } ); - if ( @$orphan_budgets ) { - for my $b ( @$orphan_budgets ) { - print "Fund $b->{budget_name} (code:$b->{budget_code}, id:$b->{budget_id}) does not have a parent, it may cause problem\n"; - } - print "Upgrade to $DBversion done (Bug 12905: Check budget integrity: FAIL)\n"; - } else { - print "Upgrade to $DBversion done (Bug 12905: Check budget integrity: OK)\n"; - } SetVersion ($DBversion); } -- 2.25.1