Koha/installer/data/mysql/db_revs/230600013.pl
Kyle M Hall 07097737e6 Bug 35687: Fix db rev for 23.06.00.013
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit aadb617235)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2024-01-29 10:08:52 +01:00

24 lines
885 B
Perl
Executable file

use Modern::Perl;
return {
bug_number => "28966",
description => "Holds queue view too slow to load for large numbers of holds",
up => sub {
my ($args) = @_;
my ( $dbh, $out ) = @$args{qw(dbh out)};
unless ( primary_key_exists( 'tmp_holdsqueue', 'itemnumber' ) ) {
$dbh->do(q{ALTER TABLE tmp_holdsqueue DROP CONSTRAINT `tmp_holdsqueue_ibfk_1`});
$dbh->do(q{ALTER TABLE tmp_holdsqueue ADD PRIMARY KEY (itemnumber)});
$dbh->do(
q{
ALTER TABLE tmp_holdsqueue ADD CONSTRAINT `tmp_holdsqueue_ibfk_1`
FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`)
ON DELETE CASCADE ON UPDATE CASCADE
}
);
}
say $out "Set primary key for table 'tmp_holdsqueue' to 'itemnumber'";
},
};