From 07097737e6fb70bc6527e439102e5443fbb650ad Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 3 Jan 2024 09:31:59 -0500 Subject: [PATCH] Bug 35687: Fix db rev for 23.06.00.013 Signed-off-by: Emily Lamancusa Signed-off-by: Marcel de Rooy Signed-off-by: Katrin Fischer (cherry picked from commit aadb6172352c7e1dcdbfd6607d2ca9d3da4af090) Signed-off-by: Fridolin Somers --- installer/data/mysql/db_revs/230600013.pl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/installer/data/mysql/db_revs/230600013.pl b/installer/data/mysql/db_revs/230600013.pl index 55a7db5827..e9b4aca87e 100755 --- a/installer/data/mysql/db_revs/230600013.pl +++ b/installer/data/mysql/db_revs/230600013.pl @@ -8,8 +8,14 @@ return { 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 PRIMARY KEY (itemnumber)} + q{ + ALTER TABLE tmp_holdsqueue ADD CONSTRAINT `tmp_holdsqueue_ibfk_1` + FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) + ON DELETE CASCADE ON UPDATE CASCADE + } ); } -- 2.39.5