Koha/installer/data/mysql/db_revs/210600022.pl
Jonathan Druart 8022543d93 Bug 29605: Missing FK on tmp_holdsqueue.borrowernumber (tmp_holdsqueue_ibfk_3)
Bad copy paste on the foreign_key_exists condition

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-02-01 21:39:39 -10:00

22 lines
904 B
Perl
Executable file

use Modern::Perl;
return {
bug_number => "28972",
description => "Add missing foreign key constraints to holds queue table",
up => sub {
my ($args) = @_;
my ($dbh, $out) = @$args{qw(dbh out)};
unless ( foreign_key_exists('tmp_holdsqueue', 'tmp_holdsqueue_ibfk_2') ) {
$dbh->do(q{
ALTER TABLE tmp_holdsqueue
ADD CONSTRAINT `tmp_holdsqueue_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE
});
}
unless ( foreign_key_exists('tmp_holdsqueue', 'tmp_holdsqueue_ibfk_3') ) {
$dbh->do(q{
ALTER TABLE tmp_holdsqueue
ADD CONSTRAINT `tmp_holdsqueue_ibfk_3` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE
});
}
},
}